TWITTER 实习OA

  1. GIVEN AN ARRAY A[] FIND WHETHER WE CAN SPLIT THE ARRAY INTO SUBSEQUENCE OF SIZE K SATISFYING THE FOLLOWING CONDITIONS
  • SUBSEQUENCE MUST BE UNIQUE
  • EACH ELEMENT IN THE ARRAY SHOULD PRESENT ATMOST ONCE
  • SUBSEQUENCE SIZE MUST BE K
  • eg: [1,2,3,4] k=2
  • return “Yes”
  • eg:[4,8,8,8,6,4] k=3
  • return “No”
  1. A truck owner needs to Fiill his truck with maximum capacity .given an array of loads he needs to start at index “0”.If the load add’s to more than the capacity of truck he needs to sell the remaining or if the load available is less than the capacity he needs to buy the remaining load return the buy or sell amount return 0 if load=maxcapacity
    eg:A=[10,20,30,40,15] CAPACITY =80
    return 20(units he needs to sell)
    (10+20+30+40)-80
    if capacity=130
    130-(10+20+30+40+15)=15 extra units (he needs to buy)
    return 15
  2. Minimum no.of fountains to water the garden
    https://stackoverflow.com/questions/57235038/find-minimum-no-of-fountains-needed
  3. https://www.geeksforgeeks.org/making-elements-distinct-sorted-array-minimum-increments/

时间是24小时
I applied on Oct 29 got the link on oct 31