Anyone Solved Infosys Preparation Kit ?
I got my exam Scheduled on 17th may 10 am but struggling to solve their sample question papers anyone with solutions who can help me out?
I got my exam Scheduled on 17th may 10 am but struggling to solve their sample question papers anyone with solutions who can help me out?
Given an array a of length n and an integer k.
You must perform the following operation exactly k times: choose two indices i, j and swap**(ai, aj).**
Find the maximum possible MSS (maximum subarray sum) after performing the above operation exactly k times.
Note: Swapping the same pair again is allowed but useless (a double-swap cancels out). Therefore, performing exactly k swaps is equivalent to at most k useful swaps.
Input Format The first line contains an integer, n, denoting the size of array The next line contains an integer, k, denoting the number of swaps.
Each line i of the n subsequent lines (where 0 ≤ i < n) contains an integer describing a[i].
Constraints 2 <= n <= 500 0 <= k <= n -1000 <= a[i] <= 1000
Sample Test Cases Case 1 Input: 3 1 1 -5 2 Output: 3
Explanation: By swapping 1 and -5, we get a maximum subarray sum equal to 1 + 2 = 3.
Case 2 => Input: 3 0 5 -1 5
Output: 9
how can we solve this problem??
I was trying too solve leetcode 31 which is Next permutation at first i was unable to understand what actually ques is asking.
How to solve these type of Questions?
Virat Kohli will never play test cricket ever again.
VIRAT KOHLI RETIRED FROM TEST CRICKET "OTD IN 2025"
- 123 Test.
- 9230 Runs.
- 46.85 Average.
- 30 Hundreds.
- 31 Fifties.
- 40 wins in 68 Tests as Captain.
The Greatest Indian Test Captain in the history!
RAHUL DRAVID ANNOUNCED AS OWNER OF EUROPEAN T20 PREMIER LEAGUE’S DUBLIN GUARDIANS FRANCHISE
>This is for you PAPA"
(Tamaru sapnu aaje puru thayu cricketer motu banine batavyu)
String in java is always Pass by Value Right ? then how to solve permutations problem using backtracking technique
He completed 100 sixes in just 515 balls.
read a reddit post saying that setTimeOut functions and addEventListener and similar like these are not part of javascript language they are build by v8 or other engines.
Any one who can give me clarity?