Close

Gas station problem

There are some gas stations arranged in a circle. Each of them has some amount of gas. We are also given the distances between all the consecutive stations. Assume that we have a vehicle with very large fuel tank(infinite) and one unit of gas is needed to cover one unit of distance, the problem is…

Last digit of a power

Given a number expressed in base, exponent form (ab) where a is arbitrary big number For example contains 100 digits, We have to write a program to find the last digit in it’s expanded form. Eg: 45712 has a last digit of 1 Since the range of numbers is huge, it is impossible to expand…