Employment Hero | Senior Backend Engineer
Anonymous User
111

Problem #1

  • Given a list of moves (<, >, v, ^) starting from (0,0) in a x,y coordinates. Determine if the path form a rectangle. Moves are guarantee to not duplicated

Example
- >^v< => true
- >^^v< => false

Problem #2

  • Given a set of cards with suit and rank (suit: S, D, H, C), (rank: 2,3,...,10,J,Q,K,A)
    • Detect if these sets of cards can be form (each set has different strong level - single: weakest, triple and pair: strongest)
      • Single: highest ranked card (suit doesn't matter)
      • Pair: 2 cards with the same rank (suit doesn't matter). If there are multiple answers, select the highest rank
      • Triple: 3 cards with the same rank (suit doesn't matter). If there are multiple answers, select the highest rank
      • Five consecutive cards: 5 cards consecutive increasing rank (e.g 2S, 3A, 4D, 5H, 6A). If there are multiple ans, select the one with the highest rank
      • Suit: 5 cards with the same suit (e.g [10S, 2S, 4S, JS, 5S])
      • Triple and a pair: has 2 cards with the same rank and 3 cards with the same rank (e.g [10S, 10A, 10H, 2S, 2H, 2D, JS, JH] => [10S, 10A, 10H, JS, JH])
    • If there are multiple sets that can be form, return the strongest set
Comments (0)