Пікірлер
@HarryWillson-u2b
@HarryWillson-u2b Ай бұрын
Keep it up
@CodeBreakz
@CodeBreakz Ай бұрын
@@HarryWillson-u2b Yes I will 😊
@ChandniS175
@ChandniS175 Ай бұрын
❤️🎉🙌🏻✨
@CodeBreakz
@CodeBreakz Ай бұрын
This can also be fixed by setting the material to double sided but it comes with an additional computational Cost
@ChandniS175
@ChandniS175 Ай бұрын
Very informative and nice explanation .. found this explanation very helpful ❤️🙌🏻✨
@CodeBreakz
@CodeBreakz Ай бұрын
Chal bata kya padhaya maine 😂😂
@livingcode
@livingcode Ай бұрын
search drawtocode
@CodeBreakz
@CodeBreakz Ай бұрын
Thanks for telling i will surely make use of it
@livingcode
@livingcode Ай бұрын
@@CodeBreakz Thanks for your interest! 😊 Use DrawToCode at 75% zoom for the best experience, and don't forget to refresh the page after adjusting. Happy coding!
@livingcode
@livingcode Ай бұрын
@@CodeBreakz Thanks for your interest! 😊 Use DrawToCode at 75% zoom for the best experience, and don't forget to refresh the page after adjusting. Happy coding!
@livingcode
@livingcode Ай бұрын
@@CodeBreakz Thanks for your interest! 😊 Use DrawToCode at 75% zoom for the best experience, and don't forget to refresh the page after adjusting. Happy coding!
@livingcode
@livingcode Ай бұрын
@@CodeBreakz Thanks for your interest! 😊 Use DrawToCode at 75% zoom for the best experience, and don't forget to refresh the page after adjusting. Happy coding!
@DailyLearning-tc9wx
@DailyLearning-tc9wx 5 ай бұрын
Aap konse college mai hai
@CodeBreakz
@CodeBreakz 5 ай бұрын
Sorry bro but i cant share it you can contact me on insta link is in description
@ChandniS175
@ChandniS175 5 ай бұрын
Nice ! Keep it up 👍🏻✨👏🏻👏🏻
@CodeBreakz
@CodeBreakz 5 ай бұрын
Thank you! 😃
@ChandniS175
@ChandniS175 5 ай бұрын
Amazing explanation ! ❤️👍🏻✨
@CodeBreakz
@CodeBreakz 5 ай бұрын
Glad you liked it
@GrimReaper-qy1wz
@GrimReaper-qy1wz 5 ай бұрын
Bro if array is 0 , 6 , 7 for 2nd question what should be the output? YES or NO
@CodeBreakz
@CodeBreakz 5 ай бұрын
It would be No Just a simple logic first number is 0 so we cant iterate through it 2nd number is 6 so set b= { 6 : 1 } And count += 1 --> 1 3rd number is 7 so set b = { 6:1 , 7:1 } And count +=1 --> 2 Now finally our count total is 2 which is greater than 1 Count > 1 so answer is No
@StrawDev
@StrawDev 5 ай бұрын
bro in last question u didn't explain that how u generated that formula
@CodeBreakz
@CodeBreakz 5 ай бұрын
@@StrawDev basically it calculates the ascii value of 1st and last charecter of string we put base value as 2 and sum of 2 zero charecters and then subtracted the 0th char and the last char basically The formula is designed to calculate a result based on the ASCII values of the characters at the ends of the binary string, with adjustments and normalization factors. The min(..., n) ensures the result is within the length of the string, handling specific constraints or requirements of the problem.
@rupeshh7
@rupeshh7 5 ай бұрын
Nice
@CodeBreakz
@CodeBreakz 5 ай бұрын
Thanks
@DailyLearning-tc9wx
@DailyLearning-tc9wx 5 ай бұрын
Kya aap contest ke que bhi karayege
@CodeBreakz
@CodeBreakz 5 ай бұрын
Yes for sure
@DailyLearning-tc9wx
@DailyLearning-tc9wx 5 ай бұрын
Bhaiyaa aap ki rating kya hai codechef mai
@CodeBreakz
@CodeBreakz 5 ай бұрын
3*
@rupeshh7
@rupeshh7 5 ай бұрын
Bhaiya kuch tips do na 😋
@CodeBreakz
@CodeBreakz 5 ай бұрын
You can contact me on my instagram handle instagram.com/urs_p_ubuntu?igsh=MTAzMWk0NHhoYzZnMg==
@rupeshh7
@rupeshh7 5 ай бұрын
Bhaiya aap toh itne hushaar ho , aap toh Google mai honge na 🤔🤗
@CodeBreakz
@CodeBreakz 5 ай бұрын
No actually I am a student
@ChandniS175
@ChandniS175 6 ай бұрын
Very nice !! Explanation keep it up ❤️👏🏻👏🏻👍🏻
@CodeBreakz
@CodeBreakz 6 ай бұрын
Thank you! 😃
@shitalghodmare1274
@shitalghodmare1274 6 ай бұрын
Nice explanation
@PrathameshChandrashekharGhodma
@PrathameshChandrashekharGhodma 6 ай бұрын
Nice explanation
@chandrashekharghodmare8000
@chandrashekharghodmare8000 6 ай бұрын
Nice explanation
@studyyoutube8997
@studyyoutube8997 6 ай бұрын
dark mode
@ujjwalrockriser
@ujjwalrockriser 6 ай бұрын
Bhai, contest ko mazaak kyun banake rakha hai, ye rating talented logo ko apna capabilities dikhane ka ek jariya hai, please chhod de
@CodeBreakz
@CodeBreakz 6 ай бұрын
Bro, I know you are very honest, but why are you coming and looking at contest solutions? These are meant to help beginners, not for people preparing for Google interviews like you.
@clashwithstyle6397
@clashwithstyle6397 6 ай бұрын
@@CodeBreakz I too came but not to look at your solutions but to report the channel xD
@ishaanms9194
@ishaanms9194 6 ай бұрын
bro how to visualize python code?
@CodeBreakz
@CodeBreakz 6 ай бұрын
You have to just read the code line by line for each iteration . I have uploaded more precise Explanation in drive: drive.google.com/file/d/1MzNDI2hLlTuPHSJmyFVnIXeo8EPpTne8/view?usp=drivesdk then also if you have any doubt you can comment me
@ishaanms9194
@ishaanms9194 6 ай бұрын
@@CodeBreakz thank you🙏
@ishaanms9194
@ishaanms9194 6 ай бұрын
@@CodeBreakz thank you for sharing drive... I'm freshie learning dsa, already I studied ml... after watching tutorial in dsa I'm unable to solve any problem should I just read others code n dry code it or something else should I do??
@CodeBreakz
@CodeBreakz 6 ай бұрын
Listen try to solve easy level problems in leetcode or any other platforms practice it and then move on the medium level problems which are of the same type For example : 1. Minimum Number of K Consecutive Bit Flips 2. Minimum Operations to Make Binary Array Elements Equal to One I Both are of same type just way to solve and approach varies so try to solve easy level problems then go on same type problem but with more difficulty and try solving problem by yourself first then if you feel you can see other code but try to understand how the loops try to find the answer
@ishaanms9194
@ishaanms9194 6 ай бұрын
@@CodeBreakz I'll surely follow this technique thank you🙏
@suresurya-ub4wu
@suresurya-ub4wu 7 ай бұрын
Hlo bro
@CodeBreakz
@CodeBreakz 7 ай бұрын
Hello !!
@kingkong76749
@kingkong76749 7 ай бұрын
bahut kharab explanation
@CodeBreakz
@CodeBreakz 7 ай бұрын
I will try to improve thank you for your response
@Akash_bhai8477
@Akash_bhai8477 7 ай бұрын
Bhai tujhse nahi hoga rehne de 😂
@CodeBreakz
@CodeBreakz 7 ай бұрын
Thanks for your feedback! I'll keep working on improving my content.
@chinmay.sharma
@chinmay.sharma 7 ай бұрын
Amazing explanation!... Thank you:)
@CodeBreakz
@CodeBreakz 7 ай бұрын
Glad you liked it
@CodeBreakz
@CodeBreakz 7 ай бұрын
Java code Scanner scanner = new Scanner(System.in); int T = scanner.nextInt(); scanner.nextLine(); // consume the newline after T int[] results = new int[T]; for (int i = 0; i < T; i++) { String S = scanner.nextLine(); int min_horizontal = 0, max_horizontal = 0, min_vertical = 0, max_vertical = 0; if (S.charAt(0) == '1') { min_horizontal = -10; } if (S.charAt(1) == '1') { max_horizontal = 10; } if (S.charAt(2) == '1') { max_vertical = 10; } if (S.charAt(3) == '1') { min_vertical = -10; } int number_of_cells = (max_horizontal - min_horizontal + 1) * (max_vertical - min_vertical + 1); results[i] = number_of_cells; } for (int result : results) { System.out.println(result); }
@CodeBreakz
@CodeBreakz 7 ай бұрын
Python code import sys input_func = sys.stdin.read data = input_func().split() T = int(data[0]) results = [] for i in range(1, T + 1): S = data[i] min_horizontal, max_horizontal = 0, 0 min_vertical, max_vertical = 0, 0 if S[0] == '1': min_horizontal = -10 if S[1] == '1': max_horizontal = 10 if S[2] == '1': max_vertical = 10 if S[3] == '1': min_vertical = -10 number_of_cells = (max_horizontal - min_horizontal + 1) * (max_vertical - min_vertical + 1) results.append(number_of_cells) for result in results: print(result)
@CodeBreakz
@CodeBreakz 7 ай бұрын
Java code Scanner scanner = new Scanner(System.in); // Number of test cases int numTestCases = scanner.nextInt(); // To store the results for each test case int[] results = new int[numTestCases]; for (int testCase = 0; testCase < numTestCases; testCase++) { // Size of the array int arraySize = scanner.nextInt(); int[] array = new int[arraySize]; // Input array elements for (int i = 0; i < arraySize; i++) { array[i] = scanner.nextInt(); } // Calculate the total sum of the array int totalSum = 0; for (int num : array) { totalSum += num; } if (totalSum % 2 == 0) { // If total sum is even, the largest subarray is the entire array results[testCase] = arraySize; } else { // If total sum is odd, find the first and last odd element indices int leftOddIndex = -1; int rightOddIndex = -1; for (int i = 0; i < arraySize; i++) { if (array[i] % 2 != 0) { leftOddIndex = i; break; } } for (int i = arraySize - 1; i >= 0; i--) { if (array[i] % 2 != 0) { rightOddIndex = i; break; } } // Determine the largest subarray length with even sum by removing one odd element if (leftOddIndex == 0 || rightOddIndex == arraySize - 1) { results[testCase] = arraySize - 1; } else { results[testCase] = Math.max(arraySize - 1 - leftOddIndex, rightOddIndex); } } } // Print all results for (int result : results) { System.out.println(result); } scanner.close();
@CodeBreakz
@CodeBreakz 7 ай бұрын
Python code # Number of test cases num_test_cases = int(input()) # To store the results for each test case results = [] for test_case in range(num_test_cases): array_size = int(input()) array = list(map(int, input().split())) total_sum = sum(array) if total_sum % 2 == 0: # If total sum is even, the largest subarray is the entire array results.append(array_size) else: # If total sum is odd, find the first and last odd element indices left_odd_index = -1 right_odd_index = -1 for i in range(array_size): if array[i] % 2 != 0: left_odd_index = i break for i in range(array_size - 1, -1, -1): if array[i] % 2 != 0: right_odd_index = i break # Determine the largest subarray length with even sum by removing one odd element if left_odd_index == 0 or right_odd_index == array_size - 1: results.append(array_size - 1) else: results.append(max(array_size - 1 - left_odd_index, right_odd_index)) # Print all results for result in results: print(result)
@bitsforbits6581
@bitsforbits6581 8 ай бұрын
i dont get this logic....please explain bro
@CodeBreakz
@CodeBreakz 7 ай бұрын
I have uploaded a video explanation of this question you can see that by the way sorry bro for late reply
@bitsforbits6581
@bitsforbits6581 7 ай бұрын
i understood the logic it was difficult to understand in first try😅​@@CodeBreakz
@CodeBreakz
@CodeBreakz 8 ай бұрын
import sys input = sys.stdin.read # Read the input data = input().split() T = int(data[0]) results = [0] * T sum_of_first_nine = 45 # 1 + 2 + ... + 9 index = 1 for i in range(T): N = int(data[index]) index += 1 full_cycles = N // 9 remainder = N % 9 # Sum from complete cycles and the remaining part result = full_cycles * sum_of_first_nine + (remainder * (remainder + 1)) // 2 results[i] = result # Output the sum of original values for res in results: print(res)
@CodeBreakz
@CodeBreakz 8 ай бұрын
def count_non_consecutive_pairs(s, n): count_pairs = 0 i = 1 while i < n: if s[i] == s[i - 1]: count_pairs += 1 i += 1 i += 1 return count_pairs def main(): num_test_cases = int(input()) for _ in range(num_test_cases): length = int(input()) moves = input() result = count_non_consecutive_pairs(moves , length) print(length- result) if __name__ == "__main__": main()
@CodeBreakz
@CodeBreakz 8 ай бұрын
import java.util.*; import java.lang.*; import java.io.*; class Codechef { public static void main (String[] args) throws java.lang.Exception { // your code goes here Scanner scanner = new Scanner(System.in); int cases = scanner.nextInt(); for (int k = 0; k < cases; k++) { int amount = scanner.nextInt(); int year = scanner.nextInt(); int result = 0; for (int i = 0; i < year; i++) { if (amount * 2 > amount + 1000) { amount *= 2; result = amount; } else { amount += 1000; result = amount; } } System.out.println(result); } scanner.close(); } }
@CodeBreakz
@CodeBreakz 8 ай бұрын
# cook your dish here for k in range(int(input())): amount,year=map(int,input().split()) result=0 for i in range(year): if(amount*2>amount+1000): amount*=2 result=amount else: amount+=1000 result=amount print(result)
@CodeBreakz
@CodeBreakz 8 ай бұрын
t=int(input()) for i in range(t): n=int(input()) # n is number of integers in n array a=list(map(int,input().split())) subarray = [1]*n # initialises a list subarray of length n with all elements set to 1 # last element always though it may be positive or negative for i in range(n-2,-1,-1): if (a[i]*a[i+1]<0): # 2 -2 -3 # -3*-2==6>0 #last second element is 1 # -2*2=-4<0 # last third element is 1+1=2 # subarray= 2 1 1 subarray[i]=subarray[i+1]+1 else: subarray[i]=1 print(*subarray) # subarray 2 1 1 without* it will print 211 which will give error
@CodeBreakz
@CodeBreakz 8 ай бұрын
whatsapp.com/channel/0029VaUDt2Q23n3kqYyoP43U
@CodeBreakz
@CodeBreakz 8 ай бұрын
class Solution: def isPalindrome(self, x: int) -> bool: if x < 0: return False reversed_num = 0 temp = x while temp != 0: digit = temp % 10 reversed_num = reversed_num * 10 + digit temp //= 10 return reversed_num == x
@CodeBreakz
@CodeBreakz 8 ай бұрын
whatsapp.com/channel/0029VaUDt2Q23n3kqYyoP43U
@CodeBreakz
@CodeBreakz 8 ай бұрын
class Solution { public int[] twoSum(int[] nums, int target) { Map<Integer,Integer> map= new HashMap<>(); // Map and HashMap these are in built codes for writing HashMap for(int i=0;i<nums.length;i++){ // nums={2,7,11,15} and our target element is target=9 // nums.length=4 int substract= target-nums[i]; // substract=9-nums[0 // substract =9-2=7 if(map.containsKey(substract)){ return new int[]{ map.get(substract),i}; } map.put(nums[i],i); } throw new IllegalArgumentException(" No 2 sums have solution"); } }
@CodeBreakz
@CodeBreakz 8 ай бұрын
whatsapp.com/channel/0029VaUDt2Q23n3kqYyoP43U
@CodeBreakz
@CodeBreakz 8 ай бұрын
# Code by Prathamesh Ghodmare class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: for i in range(len(nums)): # nums=[2,7,11,15] # len(nums)=4 for j in range(i+1,len(nums)): #i+1=0+1=1 #len(nums)=4 #j will start from 1 to 4 if nums[j]==target-nums[i]: #nums[j]=7. and target=9. also nums[i]=2 # 7==9-2 return [i,j]
@CodeBreakz
@CodeBreakz 8 ай бұрын
whatsapp.com/channel/0029VaUDt2Q23n3kqYyoP43U
@CodeBreakz
@CodeBreakz 8 ай бұрын
whatsapp.com/channel/0029VaUDt2Q23n3kqYyoP43U
@CodeBreakz
@CodeBreakz 8 ай бұрын
whatsapp.com/channel/0029VaUDt2Q23n3kqYyoP43U
@CodeBreakz
@CodeBreakz 8 ай бұрын
import java.util.*; import java.lang.*; import java.io.*; class Codechef { public static void main(String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t > 0) { int n = sc.nextInt(); int arr[] = new int[n + 1]; for (int i = 1; i <= n; i++) { arr[i] = sc.nextInt(); } long ans = 0; for (int i = 1; i <= n; i++) { long left = (long) arr[i]; if (left == 1) { ans += (long) n; } else { long power = 1; for (int j = 1; j <= n; j++) { power *= left; if (power > 1000000000L) { break; } else { long right = (long) arr[j]; if (power <= right) { ans++; } } } } } System.out.println(ans); t--; } } }
@CodeBreakz
@CodeBreakz 8 ай бұрын
import java.util.*; class Codechef { public static void main(String[] args) throws java.lang.Exception { Scanner jk = new Scanner(System.in); int t = jk.nextInt(); while (t > 0) { int vk = jk.nextInt(); PriorityQueue<Integer> max = new PriorityQueue<>(Collections.reverseOrder()); PriorityQueue<Integer> min = new PriorityQueue<>(); for (int j = 0; j < vk; j++) { int va = jk.nextInt(); max.add(va); min.add(va); } int ans = 0; int to = vk / 2; while (to > 0) { int ge = max.poll(); int small = min.poll(); int df = ge - small; ans += df; to--; } if (vk % 2 != 0) { ans += min.poll(); } System.out.println(ans); t--; } } }