In this repository I collect all the algorithmic tasks I have solved. Each assignment has been solved by me, but not all solutions are mine.
Write a program that prints the numbers from 1 to 100 and for multiples of '3' print "Fizz" instead of the number and for the multiples of '5' print "Buzz".
My solution returns String values instead of printing to console.
Write a function that takes array of integer numbers and returns two elements, the sum of which is smallest in a whole array
Instead of sorting the array, you can traverse the array only once, which gives O(n) complexity.
Given an array of integers and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. Array of integers is not sorted.
Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. Assume the environment does not allow you to store 64-bit integers (signed or unsigned).
Given an integer x, return true if x is palindrome integer. An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not.
Given a roman numeral, convert it to an integer. Constraints:
- String roman contains only the characters ('I', 'V', 'X', 'L', 'C', 'D', 'M')
- It is guaranteed that roman is a valid roman numeral in the range [1, 3999]