Coding | EXAMS | IBM ACCENTURE | VIRTUSA | IBM | AMAZON | TCS | EPAM | WILEY EDGE | TECH MAHINDRA | JPMORGAN | HCL | WIPRO
3.37K subscribers
1.13K photos
3 videos
17 files
373 links
Main channel https://t.me/Coding_000
Contact Admin 👉 @ILOVEU_143 for booking your exam slots
Web- https://coding000.github.io/Projects/
💯% clearance in any placement exams
OffCampus -https://t.me/Offcampus_000
Discussion- https://t.me/exams_discussion
Download Telegram
Share screenshot of my channel to larger groups if u need coding answers also
👍4
def NextSmallerNumber(a):
    if a is None:
        return None

    n = len(a)
    result = [-1] * n
    stack = []

    for i in range(n - 1, -1, -1):
        while stack and stack[-1] >= a[i]:
            stack.pop()

        if stack:
            result[i] = stack[-1]

        stack.append(a[i])

    return result



python
👍2
int LetteredNumberSum(char* str, int len) {
    if (str == nullptr) {
        return 0;
    }

    int sum = 0;
    for (int i = 0; i < len; i++) {
        char letter = str[i];
        int ans = 0;
//@ILOVEU_143
        switch (letter) {
            case 'A':
                ans = 1;
                break;
            case 'B':
                ans = 10;
                break;
            case 'C':
                ans = 100;
                break;
            case 'D':
                ans = 1000;
                break;
            case 'E':
                ans = 10000;
                break;
            case 'F':
                ans = 100000;
                break;
            case 'G':
                ans = 1000000;
                break;
            default:
                ans = 0;
                break;
        }

        sum += ans;
    }

    return sum;
}

C++
👍2
Start exam late...6:50
Guys i will share Ans here...😊

All the best...❤️👨‍💻
2
Give reactions guys..and share our channel...to get more solutions...❤️😁
👍21🥰1