Heavy Coins Bahosain has a lot of coins in his pocket. These coins are really heavy, so he always tries to get rid of some of the coins by using them when paying for the taxi. Whenever Bahosain has to pay S pennies for the taxi driver, he tries to…
Runtime Error Bahosain was trying to solve this simple problem, but he got a Runtime Error on one of the test cases, can you help him by solving it? Given an array of N non-negative integers and an integer K, your task is to find two integers X and…
Rock-Paper-Scissors Rock-Paper-Scissors is a two-player game, where each player chooses one of Rock, Paper, or Scissors. Here are the three cases in which a player gets one point: Choosing Rock wins over a player choosing scissors. …
Travelling Salesman After leaving Yemen, Bahosain now works as a salesman in Jordan. He spends most of his time travelling between different cities. He decided to buy a new car to help him in his job, but he has to decide about the capacity of the…
Epic Professor Dr. Bahosain works as a professor of Computer Science at HU (Hadramout University). After grading his programming exam, he noticed that most of the students have failed. Since this is the last semester for him teaching in Yemen, D…
Street Lamps Bahosain is walking in a street of N blocks. Each block is either empty or has one lamp. If there is a lamp in a block, it will light it’s block and the direct adjacent blocks. For example, if there is a lamp at block 3, it will light…