Posts

"The first and last occurrence: Given a string that may or may not contain a letter of interest. Print the index location of the first and last appearance of f. If the letter f occurs only once, then output its index. If the letter f does not occur, then do not print anything. Don't use loops in this task. " - Snakify python coding question

"Sum of ten numbers: 10 numbers are given in the input. Read them and print their sum. Use as few variables as you can. " - Snackify python coding question

"Series - 2: Given two integers A and B. Print all numbers from A to B inclusively, in ascending order, if A < B, or in descending order, if A ≥ B. " - Snackify python coding question

"Series - 1 : Given two integers A and B (A ≤ B). Print all numbers from A to B inclusively. " - Snackify python coding question

"Leap year: Given the year number. You need to check if this year is a leap year. If it is, print LEAP, otherwise print COMMON. " - Snackify python coding question

"Chocolate bar: Chocolate bar has the form of a rectangle divided into n×m portions. Chocolate bar can be split into two rectangular parts by breaking it along a selected straight line on its pattern. Determine whether it is possible to split it so that one of the parts will have exactly k squares." - Snackify python coding question

"Knight move: Chess knight moves like the letter L. It can move two cells horizontally and one cell vertically, or two cells vertically and one cells horizontally. Given two different cells of the chessboard, determine whether a knight can go from the first cell to the second in one move" - Snackify python coding question

"Queen move: Chess queen moves horizontally, vertically or diagonally to any number of cells. Given two different cells of the chessboard, determine whether a queen can go from the first cell to the second in one move." - Snackify python coding question

"Bishop moves: In chess, the bishop moves diagonally, any number of squares. Given two different squares of the chessboard, determine whether a bishop can go from the first to the second in one move. " - Snackify python coding question

"King move : Chess king moves horizontally, vertically or diagonally to any adjacent cell. Given two different cells of the chessboard, determine whether a king can go from the first cell to the second in one move." - Snackify python coding question

"Chess board - same color: Given two cells of a chessboard. If they are painted in one color, print the word YES, and if in a different color - NO" - Snackify python coding question

"Rook move: Chess rook moves horizontally or vertically. Given two different cells of the chessboard, determine whether a rook can go from the first cell to the second in one move." - Snackify python coding question

"Equal numbers: Given three integers, determine how many of them are equal to each other. The program must print one of these numbers: 3 (if all are the same), 2 (if two of them are equal to each other and the third is different) or 0 (if all numbers are different). " - Python coding question

"Minimum of three numbers: Given three integers, print the smallest value. " - Python coding question

"Sign function : For the given integer X print 1 if it's positive, -1 if it's negative, or 0 if it's equal to zero. Try to use the cascade if-elif-else for it. " - Python coding question

"Minimum of two numbers : Given two integers, print the smaller value." - Python coding question

"Clock face - 1: H hours, M minutes and S seconds are passed since the midnight (0 ≤ H < 12, 0 ≤ M < 60, 0 ≤ S < 60). Determine the angle (in degrees) of the hour hand on the clock face right now. " - Python coding question

"Total cost: A cupcake costs A dollars and B cents. Determine, how many dollars and cents should one pay for N cupcakes. A program gets three numbers: A, B, N. It should print two numbers: total cost in dollars and cents." - Python coding question

"Digital clock: Given the integer N - the number of minutes that is passed since midnight - how many hours and minutes are displayed on the 24h digital clock? " - Snackify python coding question

"Car route: A car can cover distance of N kilometers per day. How many days will it take to cover a route of length M kilometers? The program gets two numbers: N and M." - python coding question