Simple Coding Puzzles

Question 1
1. Find the highest odd number from the string
Example 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

Popular posts from this blog

Documentation Approach : Enterprise Management

Write your own code or do a copy paste !

Linked List Implementation : In Simple Terms