No video

#01 Find the index of the first occurrence in a string - Leetcode 28 [LeetCode Solutions]

Пікірлер: 8

  • @ahmedtharwat6179
    @ahmedtharwat617911 күн бұрын

    شكرا جدا يا باشمهندس

  • @Salah-ur2gc
    @Salah-ur2gc Жыл бұрын

    جزاك الله كل خير 💚

  • @ahmedsamiabdelalim6783
    @ahmedsamiabdelalim6783 Жыл бұрын

    عاااااااااااش كمل يا بشمهندس السلسه🥰🥰 جزاكم الله خيرا

  • @mohammedkhaled7914
    @mohammedkhaled7914 Жыл бұрын

    شكراً جداً يعطيك ألف عافية

  • @soubhimal5948
    @soubhimal5948 Жыл бұрын

    ربنا يديك الصحة

  • @abdomahmoud8769
    @abdomahmoud87695 күн бұрын

    انا حليته بدون اى built-in funcs class Solution { private: short int haystackLength; short int needleLength; short int checkCorrespondingLetters(string haystack, string needle, short int start) { for (short int i = 1; i if (needle[i] != haystack[start]) return -1; start++; } return 1; } public: short int strStr(string haystack, string needle) { haystackLength = haystack.length(); needleLength = needle.length(); for (short int i = 0; i if (haystack[i] == needle[0]) { if (checkCorrespondingLetters(haystack, needle, i + 1) == 1) return i; } } return -1; } };

Келесі