Category Archives: Coding

Posts related to Codes of programs.

HackerRank : RookieRank 4 – Server Room Safety

Server Room Safety: Hackerrank You are appointed as a system admin in a firm, and it is your responsibility to check the safety of the server racks in one of the server rooms. The server racks are arranged in an array. If any rack reaches another rack when it falls, it will cause the other rack to fall.… Read More »

CodeChef : February Challenge 2018 – Chef And The Patents

Chef And The Patents Source: CodeChef Chef has decided to start a new firm called PatentChef. However, he’s stuck with some big legal issues. Their firm has received offers from a lot of companies, so Chef told his friend Junior Chef to look over some patent cases and solve them as quickly as he can. Junior Chef is… Read More »

CodeChef : February Challenge 2018 – Chef And His Characters

Chef And His Characters Source: CodeChef Chef was reading a book. He decided to highlight all the lovely sentences of the book. He calls a sentence a lovely sentence if, after removing all the non-alphabetical characters (like punctuation and spaces) from it and converting all uppercase letters to lowercase, it is possible to choose four contiguous characters from the sentence and reorder… Read More »

CodeChef : January Challenge 2018 – K-Concatenation

K-Concatenation Source: CodeChef You are given an array A with size N (indexed from 0) and an integer K. Let’s define another array B with size N · K as the array that’s formed by concatenating K copies of array A. For example, if A = {1, 2} and K = 3, then B = {1, 2, 1, 2, 1, 2}. You have to find the maximum subarray sum of the array B. Fomally, you should compute the maximum… Read More »