LeetCode Two Sum (problem 1) C++ solution

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ย. 2024
  • This is a brute force solution.

ความคิดเห็น • 3

  • @kaizukishiro4729
    @kaizukishiro4729 21 วันที่ผ่านมา

    what did u write at the end to return the empty vector it didn't come onto the screen plss help I'm beginner to leet code please type that line on my comment reply

    • @Joshua_Shim
      @Joshua_Shim  21 วันที่ผ่านมา +1

      I returned an empty vector which is “return vector{};”

    • @Joshua_Shim
      @Joshua_Shim  21 วันที่ผ่านมา +1

      This is only to make it compile, theoretically you wouldnt need it due to the fact that there always is a pair but since the compiler would check that if the if case never passes nothing is returned, it would otherwise create an error.