Home
SELF STUDY
BrowsePracticeTestsPlaylistDoubts & solutionsFree live classesOther courses

Greedy Algorithms

Quick practice

Question 1 of 5

The set {1, 2, … n} is partitioned into two sets A and B, then the minimum value of |sum(A) - sum(B)| is

A

((n*(n+1))/2) % 2

B

0 if n is divisible by 4, 1 otherwise

C

n % 2

D

((n*(n-1))/2) % 2

Concepts

Get unlimited practice with Competitive Programming subscription

pick

Boost your performance with adaptive practice tests

pick

Practice every concept in the syllabus

pick

Compare your speed and accuracy with your peers

pick

Download the app and practice on the go