Increasing Triplet Subsequence || Leetcode JAVA || O(N)

Sdílet
Vložit
  • čas přidán 5. 09. 2024
  • Hi folks!
    Here we are solving 334. Increasing Triplet Subsequence || Leetcode C++ || O(N) time complexity || O(1) Space complexity
    Easy explanation in Hindi.
    Problem link : leetcode.com/p...
    If you have any queries reach out to me at
    linktr.ee/udya...

Komentáře • 26

  • @cooltomcatty
    @cooltomcatty Před rokem +1

    Wow what an explanation bro! 🤩🤩🤩 God bless you 🥰🥰🥰

  • @anishbishnoi29xD
    @anishbishnoi29xD Před rokem +1

    wow super bro thanks ❤️

  • @purna949
    @purna949 Před rokem +1

    Darun akta video dadavai

  • @ayanthisside
    @ayanthisside Před rokem +1

    great

  • @Yugalnasare
    @Yugalnasare Před 2 měsíci +1

    Thik Hai.....

  • @cooltomcatty
    @cooltomcatty Před rokem +2

    I just found that It's similar to partion sort (card game)

  • @rangan_dasgupta
    @rangan_dasgupta Před 4 měsíci +1

    Dammmmmmmmmmm❤❤❤❤❤

  • @asjadahmad1360
    @asjadahmad1360 Před rokem +1

    samjhane ka tarika kaafi badhiya
    keep it up bro

  • @vinaykaushikinvisble
    @vinaykaushikinvisble Před rokem +2

    why did you check for

    • @udyanojha
      @udyanojha Před rokem +1

      According to question, We want to return true only if nums[i] < nums[j] < nums[k]

    • @udyanojha
      @udyanojha Před rokem

      and by using

    • @udyanojha
      @udyanojha Před rokem

      Dry run for 1 2 1 2 1 2 3 case

  • @paras0verma
    @paras0verma Před rokem +2

    😎😎

  • @udyanishere
    @udyanishere  Před rokem

    // Python3 :
    class Solution:
    def increasingTriplet(self, nums: List[int]) -> bool:
    left, mid = sys.maxsize, sys.maxsize
    for num in nums:
    if num

  • @udyanishere
    @udyanishere  Před rokem

    // C++ :
    class Solution {
    public:
    bool increasingTriplet(vector& nums) {
    int N = nums.size();
    int left = INT_MAX;
    int mid = INT_MAX;

    for(int num : nums) {
    // num = nums[i];
    if(num

  • @udyanishere
    @udyanishere  Před rokem

    // JAVA :
    class Solution {
    public boolean increasingTriplet(int[] nums) {
    int N = nums.length;
    int left = Integer.MAX_VALUE;
    int mid = Integer.MAX_VALUE;

    for(int num : nums) {
    // num = nums[i];
    if(num