Find whether an array is a subset of another array in python | Love Babbar sheet

Sdílet
Vložit
  • čas přidán 21. 01. 2023
  • Question Link: practice.geeksforgeeks.org/pr...
    Question Name : Find whether and array is a subset of another array
    Instagram Link : / coding_crane
    CZcams Link : www.youtube.com/@codingcrane5...
    #python #python #lovebabbardsasheet #dsa #codinglife #shorts #algorithm #leetcode #hackerrank #learning #learn #nonmedical #engineering #viral #trending #codecademy #codechef #study #students

Komentáře • 6

  • @shejalsingh6079
    @shejalsingh6079 Před rokem

    very well explained 👍

  • @rohittiwari7113
    @rohittiwari7113 Před 7 měsíci +2

    i tried your above mentioned solution but it failed for duplicate items there for i tried this:
    for i in range(m):
    if a2[i] in a1:
    a1.remove(a2[i])
    else:
    return "No"
    return "Yes"
    and it worked
    btw your approach was very near to that : )

  • @gautamdewasiofficial
    @gautamdewasiofficial Před měsícem

    your logic is correct,but solution required max(n,m) time complexity. and your solution is of o(n^2) . will not accepted

  • @grenade1878
    @grenade1878 Před 3 měsíci

    Mam u don"t you anything about dsa logic why are u wasting time of innocent students your logic is totally wrong..........