Skip to content

SirGrant11788/Coding-Problems

Repository files navigation

Coding-Problems

Collection of Problems and Solutions

2dArray - Two dimensional times table out.

ArrayInsertionSort - Insertion sort example.

CreatePDF - Outputs an invoice in pdf format.

Delegate - Working example of delegates.

EncodedMessages - Given the mapping a=1, b=2..z= 26 and an encoded message, count the number of ways it can decoded.

Fibonacci - Write a method Fib() that takes an integer nn and returns the nnth Fibonacci ↴ number.

LinkedListSwap - Working example of swapping nodes in a linked list.

ListAddUpToK - Search an array to determine which combinations add up to the int k.

MonteCarlo - The area of a circle is define as piRsquared. Estimate pi to three decimal places using monte carlo method.

Palindrome - Given a string which we can delete at most k, return whether you can make a palindrome.

Recurring - Given a string, return the first recurring character in it, or null if there is no recurring character.

ReverseReturn - Given a 32-bit integer, return the number with its bits reversed.

RootBinaryTree - Search a binary tree.

StackVsQueue - Working example of stack and queue methods.

Rearrange - Given a string with repeated characters, rearrange the string so that no two adjacent characters are the same.If this is not possible, return None. For example, given "aaabbc", you could return "ababac". Given "aaab", return None.

MapPrefix - Implement a PrefixMapSum class with the following methods: insert(key: str, value: int) : Set a given key's value in the map. If the key already exists, sum the value.

LinkedList - Given a linked list, remove all consecutive nodes that sum to zero.Print out the remaining nodes.For example, suppose you are given the input 3 -> 4 -> -7 -> 5 -> -6 -> 6. In this case, you should first remove 3 -> 4 -> -7, then -6 -> 6, leaving only 5.

TimeAngle - Given a clock time in hh:mm format, determine, to the nearest degree, the angle between the hour and the minute hands.

Knight - A knight is placed on a given square on an 8 x 8 chessboard.It is then moved randomly several times, where each move is a standard knight move.If the knight jumps off the board at any point, however, it is not allowed to jump back on. After k moves, what is the probability that the knight remains on the board?

FizzBuzz - The classic game Fizzbuzz. Play against the PC or let the PC run through the game FizzBuzz.

WebScraping - Scraping job websites.

About

Collection of Problems and Solutions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages