In order to make your Example work in the Immutable class you should change private final Engine engine to public final Engine engine; Otherwise it will not be accessible in the main class as System.out.println(immutableClass.engine.speed); I wonder how come you are bale to access private object of Engine in the main method using ImmutableClass object.
@davidg35943 күн бұрын
Again, this accent! Nope!
@hemantkumardas33336 күн бұрын
Thanks...
@shindeajinkya25069 күн бұрын
public class SeperateZeroAndOne { public static void main(String[] args) { int[] nums = {0,1,0,1,0,1}; int left=0,right=nums.length-1; System.out.println("Start it"); while(left<right) { if(nums[left]==1) { while(nums[right]!=0) { right--; } int temp=nums[left]; nums[left]=nums[right]; nums[right]=temp; } left++; right--; } for(int i:nums) { System.out.println(i); } } }
@placeholder66311 күн бұрын
Guruji how are you doing Looking for upcoming OpenAI sessions
@sankalpsaxena247111 күн бұрын
May i know how the same can be done with Python, If any is not present or displayed then it should fail it with a message
@jhonsen984212 күн бұрын
Beautiful
@piyushsoni610914 күн бұрын
Very less information provided
@Greengoldnnn14 күн бұрын
Super
@omkarkale-p7q16 күн бұрын
very nice explanation
@sajiakhanam464616 күн бұрын
Ye kya hua...humne kahan inset kia last me value....ye to wahi reh gaya...5 number insted.
@jatinukey406218 күн бұрын
Didn't though this question can be solved by sorting with some small changes!!
@omarbousbia691626 күн бұрын
Great video. But does anyone know leetcode link for this problem?
@rahuldubey75429 күн бұрын
watching it now, and its still very good compare to other tutorials. great work @Coding Simplified.
@AidanDaGreat29 күн бұрын
Bro thanks a lot!
@sinurao1017Ай бұрын
good explanation but can you simulate multiple user scenario using threads?
@FourthyearclglifeАй бұрын
Tqs ku god
@swatiomar8603Ай бұрын
What will be the complexity in average and best case and how?
@sagarkolhe988Ай бұрын
Nice explanation!! In this design pattern we are creating instance in factory class using if else depending on our requirement but what if class name of bike or car changes ? Then we need to change instance name in factory class. Can we loosely coupled it as well?
@dsa_tutorialАй бұрын
Nice Explaination
@dEviL_bIsWaJiTАй бұрын
Great Content. Thanks bhai❤
@rishabhsonkar4535Ай бұрын
clear explanation thanks
@bhupendrajat89472 ай бұрын
void addNode(Node head_ref, int pos, int data) { // Your code here if (head_ref == null) { Node newnode = new Node(data); newnode.next = null; newnode.prev = null; } Node current = head_ref; for (int i = 0; i < pos + 1; i++) { Node newnode = new Node(data); // Corrected typo if (i == pos) { Node nextbig = current.next; current.next = newnode; newnode.prev = current; newnode.next = nextbig; // Corrected variable name nextbig.prev = newnode; // Corrected variable name } else { current = current.next; } } } }
@user-kh6rp6yx1j2 ай бұрын
Hey man.
@bhagyashrikamble31602 ай бұрын
how to print 1st 2 character ??
@ranjitasahu192 ай бұрын
Thank you so much
@DVadda-06kom2 ай бұрын
Thank you so much sir For simplified explanation.
@vishnunalubola2502 ай бұрын
Hi, why can't we use for loop to see if any row or column is empty, so we can confirm whether it's connected or not?
@pawanchormule25302 ай бұрын
nice and brief explanation
@viharivemuri72022 ай бұрын
What a silly video? You need to do all that to just sort numbers from 1 to n? Why can'y you just do for each index i, arr[i] = i+1?
@054_sunny_kumar_kushwaha42 ай бұрын
I watched your all videos on TREE and I feel it can turn anyone Zero to hero.. Mastering Binary Trees.
@elnur_talybov2 ай бұрын
Thanks a lot)
@Melissalovesroblox2 ай бұрын
Tysm
@GauravDG19902 ай бұрын
Thanks for the explanation, but will this work when numbers are negative?
@punitsharma5842 ай бұрын
#include <bits/stdc++.h> using namespace std; bool Triplet(int arr[], int arr_size, int sum) { int l, r, m; // for left ,right and middle sort(arr, arr + arr_size); for (int i = 0; i < arr_size - 2; i++) { l = 0; r = arr_size - 1; m = (l + r) / 2; while (l < r) { if (arr[l] + arr[m] + arr[r] == sum) { cout << "Triplet is: " << arr[l] << "," << arr[m] << "," << arr[r]; return true; } else if (arr[l] + arr[m] + arr[r] < sum) l++; else r--; } } return false; } int main() { int n, k, arrsize; cout << "Enter number of elements:"; cin >> n; int array[n]; cout << "Enter the elements:"; for (int i = 0; i < n; i++) { cin >> array[i]; } cout << "Enter the sum:"; cin >> k; for (int i = 0; i < n; i++) arrsize = sizeof(array) / sizeof(array[0]); Triplet(array, arrsize, k); return 0; }
@punitsharma5842 ай бұрын
if you are taking -2 as second case then -3 also will be in arraay whyyou skip those cases that"s why many of us getting error in duplicate element cases ..
@vijay556332 ай бұрын
DP solution is WRONG does NOT PASS ALL THE TEST-CASES PASSES only 84 of them has been passed.
@Ur_boi_asher3 ай бұрын
BRO ITS 2024
@rachamallidorasrivignesh44993 ай бұрын
your way of explanation is really superb brother really ...... so good please make vedeos on data structures and algorithms as well. Once again thank you so much.😊
@varunsharma00993 ай бұрын
Thanks for sharing 🤩, very nice explanation.
@krushnnabaviskar73103 ай бұрын
very well explained.
@snehaadhikary74693 ай бұрын
Great explanation. Can you please tell the time complexity for this?
@rachamallidorasrivignesh44993 ай бұрын
Thanks a lot brother for your clear explanation.
@saibm62803 ай бұрын
Very nicely explained
@Pola_B_Alex_Art3 ай бұрын
💗💗💗Many thanks!💗💗💗
@clasherrony65263 ай бұрын
amazing explaination
@tylervision707maul3 ай бұрын
no such options on mine... it doesnt have the three dots or MORE.. option