This repository contains some example codes for some questions.
Finds fair index count of two arrays. Fair index means an index that means giving same calculation result in both of arrays.
Input:
[4,-1,0,3] [-2,5,0,3]
Output:
2 fair indexes --> 2 and 3 are fair indexes.
Because if fair index is 2, in first array 4 + (-1) = 0 + 3, in second array -2 + 5 = 0 + 3.
If fair index is 3, in first array 4 + (-1) + 0 = 3, in second array -2 + 5 + 0 = 3
Produces maximum number with placing 5 into right index of number.
Input: 268
Output: 5268
Input: 670
Output: 6750
Finds count of numbers that are product of 2 consecutive numbers in given range.
Input: 6 and 20.
Output: 3 because 2*3=6, 3*4=12, 4*5=20