allcoding1
27.7K subscribers
2.2K photos
2 videos
77 files
852 links
Download Telegram
1st code
Python

Deloitte exam

Telegram:- @allcoding1
👍5
Python
2nd code
Deloitte exam

Telegram:- @allcoding1
👍3
def check_digit_position(s):
    if s[0].isdigit() and not s[-1].isdigit():
        return "Yes"
    elif not s[0].isdigit() and s[-1].isdigit():
        return "No"
    else:
        return "Invalid input"

input_str = input().strip()

print(check_digit_position(input_str))

Python
@allcoding1
👍2
def check_first_and_last_char(Str):
    if Str[0].isdigit() and not Str[-1].isdigit():
        print("Yes")
    elif Str[-1].isdigit() and not Str[0].isdigit():
        print("No")
    else:
        print("Invalid input")

Str = input()
check_first_and_last_char(Str)

Python

@allcoding1
3👍1
🎯Qualcomm Off Campus Recruitment

Job Position:- IT Software Developer (UX/UI/Fullstack)
Job ID: 3058496
Qualification:- B.Tech
Batch:- 2019/2020/2021
Job Location:- Hyderabad, India
Department: Software Engineering
Salary Package:- As per Company Standards
Job Type:- Full-time
Last Date:- ASAP

Apply Now:- https://www.allcoding1.com/2024/02/qualcomm-off-campus-recruitment-2024.html?m=1


Telegram:- @allcoding1
👍2
🎯Position: Accountant Trainee

Location: Coimbatore

Experience: Fresher

Qualification: B.Com. 2023 passed out

https://careers.banfico.com/jobs/Careers/31483000015926001/Accountant-Trainee?source=CareerSite&t=807
int solve(vector<int>& A) { int s = 0; for (const auto&n: A) { string sn = to_string(n); char md = *max_element(sn.begin().

sn.end());

s += md-'0';

}

return s;

}

C++

Telegram:- @allcoding1
L&t

Q) Encryption by digits
👍2
int solve(vector<int>& arr) { int narr.size(); if (n == 0) return 0;

int maxLen = 1;

int currLen = 1;

bool f = true;

for (int i = 1; i < n; ++i) { if ((arr[i] > arr[i-1] && f) || (arr[i] < arr[i-1] && !f)) { ++currLen; } else { maxLen = max(maxLen, currLen); currLen = 2;

f = arr[i] > arr[i-1]
}
}
maxLen = max(maxLen, currLen); return maxLen;
}



C++

Telegram:- @allcoding1
L&t

Q) Ever - increasing & ever decreasing array segments
👍2
int solve(vector<int>& arr) { int n = arr.size(); if (n == 0) return 0;

int maxLen = 1; int currLen = 1; bool f = true;

for (int i = 1; i < n; ++i) { if ((arr[i] > arr[i-1] && f) II (arr[i] < arr[i-1] && !f)) { ++currLen; } else {

maxLen = max(maxLen, currLen); currLen = 2; f = arr[i] > arr[i-1]; }

maxLen = max(maxLen, currLen); return maxLen; }

C++

Telegram:- @allcoding1

L&T
public class Solution {

    public static int longestArraySegment(int array_length, List<Integer> arr) {
        int maxLength = 1;
        int currentLength = 1;

        for (int i = 1; i < array_length; i++) {
            if (arr.get(i) > arr.get(i - 1)) {
                currentLength++;
            } else {
                currentLength = 1;
            }
            maxLength = Math.max(maxLength, currentLength);
        }

        currentLength = 1;
        for (int i = 1; i < array_length; i++) {
            if (arr.get(i) < arr.get(i - 1)) {
                currentLength++;
            } else {
                currentLength = 1;
            }
            maxLength = Math.max(maxLength, currentLength);
        }

        return maxLength;
    }

Ever increasing and ever decreasing - L&T

Java

Telegram:- @allcoding1
👍1😁1
This media is not supported in your browser
VIEW IN TELEGRAM
🎯Atos Is Hiring

Degree:- Any Graduate
Batch:- 2019, 2020, 2021, 2022, 2023 & 2024

Apply Now:- https://www.allcoding1.com/2024/02/atos-off-campus-drive-for-any-graduate.html


Telegram:- @allcoding1
👍1🥰1
int

getMinlength(vector<int>a,int k)

{

int ans=1;

long long mul=1;

for(int i=0;i<a.size();i++){

if(mul*a[i]>k){

ans++;

mul=a[i];

}

else{

mul*=a[i];

}

}

return ans;

}

L&T

@allcoding1

Q) compressing array
😁1
def helper(reward):

nums = []

for i in reward:

heappush(nums, -i)

ans = -heappop(nums)

i = 1

while nums:

temp = -heappop(nums)

if temp - i <= 0: break

ans += temp - i

i += 1

return ans

@allcoding1
👍3
🎯Atos Is Hiring

Degree:- Any Graduate
Batch:- 2019, 2020, 2021, 2022, 2023 & 2024

Apply Now:- https://www.allcoding1.com/2024/02/atos-off-campus-drive-for-any-graduate.html


Telegram:- @allcoding1
🎯Atos Is Hiring

Degree:- Any Graduate
Batch:- 2019, 2020, 2021, 2022, 2023 & 2024

Apply Now:-  https://www.allcoding1.com/2024/02/atos-off-campus-drive-for-any-graduate.html


Telegram:- @allcoding1