[Ans] How many people signed the Declaration of Independence?

How many people signed the Declaration of Independence? – 56 men signed the Declaration of Independence. The first and most famous signature on the engrossed copy was that of John Hancock, President of the Continental Congress. Hancock’s large, flamboyant signature became iconic, and John Hancock emerged in the United States as an informal synonym for … Read more

[Solution] Segmentation Fault solution codechef

Segmentation Fault solution codechef – There are NN people numbered from 11 to NN such that: Exactly one of these people is a thief and always lies; All the others are honest and always tell the truth. [Solution] Segmentation Fault solution codechef If the ithith person claims that the thief is one person out of Li,Li+1,Li+2,⋯,RiLi,Li+1,Li+2,⋯,Ri, determine how many people could be the thief. It is … Read more

[Solution] Permutation And Median solution codechef

Permutation And Median solution codechef – Given a sequence of NN elements, Chef defines a function F(i)F(i) (1≤i≤N)(1≤i≤N) as the median of the first ii elements of the sequence. [Solution] Permutation And Median solution codechef Chef wants to get a permutation PP of length NN such that Pi=F(i)Pi=F(i) ∀∀ 1≤i≤N1≤i≤N. Can you help Chef in achieving this? Note that: The median of a sequence is the middle element in the sorted order of … Read more

[Solution] Xor Permutation solution codechef

Xor Permutation solution codechef – Chef has received a challenge for which he needs your help. Given NN, find a permutation PP of numbers (1,2,…,N)(1,2,…,N) such that: Pi⊕Pi+1≠Pi+2 , where (1≤i≤N−2)Pi⊕Pi+1≠Pi+2 , where (1≤i≤N−2). Here ⊕⊕ denotes the bitwise XOR operation. [Solution] Xor Permutation solution codechef If multiple such permutations exist, print any. If no such permutation exists, print −1−1. Note that, a permutation of length NN is a sequence of NN integers P=(P1,P2,…,PN)P=(P1,P2,…,PN) such that every integer … Read more

[Solution] K-MEX solution codechef

K-MEX solution codechef – You are given an array AA containing NN integers. Find if it is possible to choose exactly MM elements from the array such that the MEX of the chosen elements is exactly KK. [Solution] K-MEX solution codechef Recall that the MEX of an array is the smallest non-negative integer that does not belong to the array. For example, the MEX of [2,2,1][2,2,1] is 00 because 00 does not belong to the … Read more

[Solution] High Accuracy solution codechef

High Accuracy solution codechef – There are 100100 questions in a paper. Each question carries +3 marks for correct answer, -1 marks for incorrect answer and 0 marks for unattempted question. [Solution] High Accuracy solution codechef It is given that Chef received exactly XX (0≤X≤100)(0≤X≤100) marks. Determine the minimum number of problems Chef marked incorrect. Input Format First line will contain TT, number of test cases. Then the test … Read more

[Ans] What are the first words of the Declaration of Independence?

What are the first words of the Declaration of Independence? – The Declaration of Independence is the pronouncement adopted by the Second Continental Congress meeting at the Pennsylvania State House in Philadelphia on July 4, 1776. Enacted during the American Revolution, the Declaration explains why the thirteen American colonies, then at war with the Kingdom … Read more

[Solution] Number of Increasing Paths in a Grid solution leetcode

Number of Increasing Paths in a Grid solution leetcode – You are given an m x n integer matrix grid, where you can move from a cell to any adjacent cell in all 4 directions. [Solution] Number of Increasing Paths in a Grid solution leetcode Return the number of strictly increasing paths in the grid such that you can start from any cell and end … Read more