Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 3.07 KB

codeforcesQuestions.md

File metadata and controls

12 lines (10 loc) · 3.07 KB

CodeForces Questions

Qu no Title Language Tags Time Space Round Approach
1 Sorting Parts C++ Sorting O(n^2) O(1) Global Round 19
  1. Check If array sorted then-"NO"; else:"YES"
2 Doors and Keys C++ String O(n) O(n) Educational Codeforces Round 123
  • Iterate over string
  • store the index of each character in variables
  • if the index value of door variable is less than key variable then print "NO"
  • 3 Anti-Fibonacci Permutation C++ Array O(n^2) O(n) Educational Codeforces Round 123
  • Sort the array in descending order
  • keep swapping the two consecutive elements of array from the last index and print the array
  • Decrement the value of index in each iteration
  • 4 Hard Way C++ Math O(1) O(1) Codeforces Round #773 (Div. 2)    co-ordinates(x,y)
  • If Any two point has same y values and the third one has less value than the other two then print the difference of the x values(which has the same y values)
  • Otherwise: print"0"
  • 5 Medium Number C++ Math O(1) O(1) Codeforces Round 835 (Div. 4) Check Conditional operations for all a , b , c values
    6 Atilla's Favorite Problem C++ String O(1) O(1) Codeforces Round 835 (Div. 4)
  • Iterate over the characters of string, calculate numeric value of each character
  • Update 'maxval' to store the maximum numeric value
  • 7 Advantage C++ Sorting O(n * log(n)) O(n) Codeforces Round 835 (Div. 4)
  • finds differences of elements with the largest element while handling duplicates.
  • Use set to get unique elements