Simple Coding Puzzles
Question 1
1. Find the highest odd number from the stringExample 1:
number="56888824"
Answer=5
Example 2:
number="56388824"
Answer=563
Logic: find the index first off number from right and then print the string from left till value found
GitHub:
2. Find if there is a loop in the linked list.
Floyd's loop detection algorithm
First pointer - next
Second pointer - next of next
If first = second, then loop exists
Comments
Post a Comment