thanks your explanation is just wow...I have solve without seeing class Solution { public int finalValueAfterOperations(String[] operations) { int x = 0; for (int i = 0; i < operations.length; i++) { if (operations[i].equals("--X") || operations[i].equals("X--")) { x = x - 1; } else { x = x + 1; } } return x; } }
Defanging an ip address can be solved in this way: class Solution { public String defangIPaddr(String address) { return address.replaceAll("\\.", "[.]"); } } And one more request anna: Try to add thumbnails of that topic so it will help
Bro last problems so funny bro jowels and stones problem nuvvu dimands ani alla cheptuntey fun ga undi last problem and so intresting laso ❤anyway bro you nailed it 😍🥰
First problem vachindi own ga macha : class Solution { public int finalValueAfterOperations(String[] operations) { int X = 0; String postincrement = "X++"; String predecrement = "--X"; String postdecrement = "X--"; String preincrement = "++X"; for (int i = 0; i < operations.length; i++) { if (operations[i].equals(preincrement) || operations[i].equals(postincrement)) { X = X + 1; } else { X = X - 1; } } return X; // Removed Math.abs(X) because the value of `X` can be negative in this context. } }
class Solution { public int finalValueAfterOperations(String[] operations) { int sum=0; for (String operation : operations) sum += operation.contains("++") ? 1 : -1; return sum; } }
1st code: class Solution { public int finalValueAfterOperations(String[] operations) { int temp = 0; for(int i =0; i< operations.length ; i++){ if ((operations[i].equals("++X")) || (operations[i].equals("X++"))){ temp++; } else{ temp--; }
class stonesandjewels { public static void main(String[] args) { int count=0; String jewels="z"; String stones="ZZ"; int n =stones.length(); for(int a=0;a
class Solution: def numJewelsInStones(self, jewels: str, stones: str) -> int: a = 0 for j in range(len(jewels)): for i in range(len(stones)): if stones[i] == jewels[j]: a+=1 return a
Macha munde vachesindi class Solution(object): def finalValueAfterOperations(self, operations): """ :type operations: List[str] :rtype: int """ x = 0 for op in operations: if "++" in op: x += 1 elif "--" in op: x -= 1 return x
class Solution { public int numJewelsInStones(String jewels, String stones) { int count = 0; for (int i=0;i< jewels.length();i++){ char a = jewels.charAt(i); for(int j=0; j< stones.length(); j++){ char b = stones.charAt(j); if (a == b){ count ++; } } } return count;
package leetcode; import java.util.Scanner; public class Jewels { public int numJewelsInStones(String jewels, String stones) { int count =0; for(int i=0;i
Question: 2011 i.e. 1st Question in this video. Leetcode Beats 76.95% class Solution { public int finalValueAfterOperations(String[] operations) { int X = 0; for (int i = 0; i < operations.length; i++){ System.out.println(operations[i]); if(operations[i].equals("--X")){ X = X - 1; } else if(operations[i].equals("X--")){ X = X - 1; } else if(operations[i].equals("X++")){ X = X + 1; } else if(operations[i].equals("++X")){ X = X + 1; } } return X; } }
Question: 1108 i.e. 2nd Question in this video. Leetcode Beats 100.0% class Solution { public String defangIPaddr(String address) { String res = address.replace(".","[.]"); return res; } }
class Solution { public int finalValueAfterOperations(String[] operations) { int n=operations.length; int a=0; //char[] arr=operations.tocharArray for(int i=0;i
Bro 😮🙏ne chaneel first time chusa No words ur teaching I have dout Bro I'm cmplt recently passed Bcom computers with 0 skills But i have boost confidence after watching ur videos naku gud package vunha job ravli anta Dsa with java chalu na bro or parrel ga inka em anaa nercunKnta best Dsa with java vera language anta em suggest cesthavhu bro nuvu?? Plz reply Big thanks for ur teaching...🙏
Incase nuvu web dev or android dev side velali ankunte dsa with java cheyu bro along with development. Incase aiml or datascience side velthe dsa with python cheyu bro . All the best
Hello, Bro One Suggestion From My Side.., Yemiti antey Every Problem ki Constraints Yeela Work Chestheya Chussi Cheppu Bro, Please Make a One Video on it, Basically.., Constraints Medha Algorithm Depend Ayyi Vuntadi kada Bro,,, Please make one Video On it Bro... This is My Request
I am really happy because I solved my first leetcode problem without watching any video Thank you so much for your motivation
Without seeing solution solve chesa anna🙂 100.0% beats 🎉
public int numJewelsInStones(String jewels, String stones){
int count =0;
for(int i=0;i
🤩
class Solution {
public int finalValueAfterOperations(String[] operations) {
int X=0;
for (int i=0;i
Thank you Macha😢 I did it! After you explaining the question in note pad without waiting for your answer and before you showed the answer 🙏🏼
thanks your explanation is just wow...I have solve without seeing
class Solution {
public int finalValueAfterOperations(String[] operations) {
int x = 0;
for (int i = 0; i < operations.length; i++) {
if (operations[i].equals("--X") || operations[i].equals("X--")) {
x = x - 1;
} else {
x = x + 1;
}
}
return x;
}
}
bro wonderful explanation i think this is the best platform to crack MNC companies
int count=0;
for(int i=0;i
Because of you now i am interested in coding tq u broo☺
int sol = 0;
for(int i=0;i
Anna after seeing your video i can solve leetcode problem easily
super machaa thankxx for ur efforts
Defanging an ip address can be solved in this way:
class Solution {
public String defangIPaddr(String address) {
return address.replaceAll("\\.", "[.]");
}
}
And one more request anna: Try to add thumbnails of that topic so it will help
Bro last problems so funny bro jowels and stones problem nuvvu dimands ani alla cheptuntey fun ga undi last problem and so intresting laso ❤anyway bro you nailed it 😍🥰
solved 1st leetcode on my own feels so goodd boommmmmmm
Bro super ga cheptunnaru bro.. keep going..🤩😍🥰
100 beats......
String jowels="abA";
String stones = "aAAbBbb";
int count = 0;
for(int i = 0; i
super Anna 😊
int count = 0;
for(int i=0;i
#2
public static String defangIPaddr(String address) {
String a = address.replace(".", "[.]");
return a;
}
First problem vachindi own ga macha :
class Solution {
public int finalValueAfterOperations(String[] operations) {
int X = 0;
String postincrement = "X++";
String predecrement = "--X";
String postdecrement = "X--";
String preincrement = "++X";
for (int i = 0; i < operations.length; i++) {
if (operations[i].equals(preincrement) || operations[i].equals(postincrement)) {
X = X + 1;
} else {
X = X - 1;
}
}
return X; // Removed Math.abs(X) because the value of `X` can be negative in this context.
}
}
class Solution{
public static void main(String[] args) {
String jewels="aA";
String stones="aAAbbbb";
int ans=0;
for(int i=0;i
this code is more simple and easier than the code in the tutorial
@@bunny.vaidya4128 its not efficient
Very interesting bro , kanisam leetcode ante teliyanu Naku yekanga problems cheyyipisthunnav super.bro chinna homework la questions ivvu bro practice cheyyadaniki baguntundi
Thanks anna present i am 1 year and beggining stage naku chala confusion undedhi but i got a hope that i will crack a expected package of mine ❤❤
All the best
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int output=0;
for(int i=0;i
class Solution {
public int finalValueAfterOperations(String[] operations) {
int sum=0;
for (String operation : operations) sum += operation.contains("++") ? 1 : -1;
return sum;
}
}
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int sum = 0;
int jewlss=0;
for(int k=0; k
nice explanation
Try to upload 2 video per day guru.... 😢
Yes bro try to upload 2 videos cause for us placements are near by..
Bro dsa last varuku chey bro
It helps a lot❤🎉
Sure bro pakka chedham last varaku
super macha
class Solution(object):
def finalValueAfterOperations(self, operations):
x=0
for i in operations:
if i=='++X' or i=='X++':
x=x+1
else:
x=x-1
return x
last problem did on own :
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int count =0;
for(int i=0;i
1st code:
class Solution {
public int finalValueAfterOperations(String[] operations) {
int temp = 0;
for(int i =0; i< operations.length ; i++){
if ((operations[i].equals("++X")) || (operations[i].equals("X++"))){
temp++;
}
else{
temp--;
}
}
return temp;
}
}
class Solution(object):
def numJewelsInStones(self, jewels, stones):
count=0
for i in stones:
if i in jewels:
count=count+1
return count
class HelloWorld {
public static void main(String[] args) {
String jewels = "aA";
String stones = "aAbbbb";
int ans = 0;
for(int i=0;i
Thank you so much anna❤❤
class Main {
public static void main(String[] args) {
for(int i=0;i
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int count =0;
for(int i=0;i
class Solution {
public String defangIPaddr(String address) {
String temp = "";
for (int i = 0; i
anna thank u so much anna chala baga chappavu thank u so much anna
class StringOperations {
public static void main(String[] args) {
String[] operations={"x++","++x","x--","--x"};
int x=0;
for(int i=0;i
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int ston =0;
for (int i=0;i
class Solution {
public int finalValueAfterOperations(String[] operations) {
int x = 0;
for(int i=0;i
class Solution {
public int finalValueAfterOperations(String[] operations) {
int ans = 0;
int n= operations.length;
for(int i=0; i
Great Explanation
Good brother keep going
Mr. Consistent🎉
Thankyou
class Solution {
public String defangIPaddr(String address) {
String ans = "";
for(int i=0;i
class Solution {
public String defangIPaddr(String address) {
for(int i=0;i
Question: 771 i.e. 3rd Question in this video.
Leetcode Beats 100.0%
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int count = 0;
for(int i=0; i < jewels.length();i++){
char c1 = jewels.charAt(i);
for(int j=0; j < stones.length();j++){
char c2 = stones.charAt(j);
if(c1 == c2){
count = count + 1;
}
}
}
return count;
}
}
I cannot wait for 6 more hours 😅
class stonesandjewels {
public static void main(String[] args) {
int count=0;
String jewels="z";
String stones="ZZ";
int n =stones.length();
for(int a=0;a
class HelloWorld
{
public static void main(String[] args)
{
String stones="zazbb",jewels="zj";
int count=0;
char c1,c2;
for(int i=0;i
Bro jewels and stones problem own ga solve chesanu
slove chesina anna 1st prblm before ur saying
class Solution:
def numJewelsInStones(self, jewels: str, stones: str) -> int:
a = 0
for j in range(len(jewels)):
for i in range(len(stones)):
if stones[i] == jewels[j]:
a+=1
return a
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int a=0;
for(int i=0;i
it is ok but using two for loops it increase time complexity.
class XYZ {
public int numJewelsInStones(String jewels, String stones) {
int ans =0;
for(int i = 0;i
Macha munde vachesindi
class Solution(object):
def finalValueAfterOperations(self, operations):
"""
:type operations: List[str]
:rtype: int
"""
x = 0
for op in operations:
if "++" in op:
x += 1
elif "--" in op:
x -= 1
return x
class Solution(object):
def defangIPaddr(self, address):
a=''
for i in address:
if i=='.':
a=a+'[.]'
else:
a=a+i
return a
class Solution {
public int finalValueAfterOperations(String[] operations) {
int x=0;
for(int i=0;i
Edhe oputho rojuki oka 5 videos pettu bro chala help avthadi. Please consider this. requesting you man🙏
with using replace function anna:
class Solution {
public String defangIPaddr(String address) {
return address.replace(".","[.]");
}
}
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int count=0;
for(int i=0;i
class Solution {
public int finalValueAfterOperations(String[] operations) {
int ans=0;
for(int i=0;i
class Solution {
public int finalValueAfterOperations(String[] operations) {
int x=0;
for(int i=0;i
//optimized code//
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int count=0;
for(int i=0;i
class Solution {
public int numJewelsInStones(String jewels, String stones) {;
int ans=0;
for(int i=0;i
class Solution {
public String defangIPaddr(String address) {
String leela=address.replace(".","[.]");
return leela;
}
}
class HelloWorld {
public static void main(String[] args) {
String jewels="aA";
String stones="aAAbbbb";
int count=0;
for (int i=0;i
class Solution {
String ans="";
public String defangIPaddr(String address) {
if(address.contains(".")){
String v= address.replace(".","[.]");
ans=ans+v;
}
return ans;
}
}
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int count=0 ;
for(int i=0;i
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int count = 0;
for (int i=0;i< jewels.length();i++){
char a = jewels.charAt(i);
for(int j=0; j< stones.length(); j++){
char b = stones.charAt(j);
if (a == b){
count ++;
}
}
}
return count;
}
}
class Solution {
public int finalValueAfterOperations(String[] operations) {
int X=0;
for(int i=0;i
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int ans = 0;
for(int i = 0; i
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int ans=0;
for(int i=0;i
package leetcode;
import java.util.Scanner;
public class Jewels {
public int numJewelsInStones(String jewels, String stones) {
int count =0;
for(int i=0;i
Question: 2011 i.e. 1st Question in this video.
Leetcode Beats 76.95%
class Solution {
public int finalValueAfterOperations(String[] operations) {
int X = 0;
for (int i = 0; i < operations.length; i++){
System.out.println(operations[i]);
if(operations[i].equals("--X")){
X = X - 1;
}
else if(operations[i].equals("X--")){
X = X - 1;
}
else if(operations[i].equals("X++")){
X = X + 1;
}
else if(operations[i].equals("++X")){
X = X + 1;
}
}
return X;
}
}
Understand Bro
Thanks verymuch anna
Question: 1108 i.e. 2nd Question in this video.
Leetcode Beats 100.0%
class Solution {
public String defangIPaddr(String address) {
String res = address.replace(".","[.]");
return res;
}
}
class Solution {
public int numJewelsInStones(String jewels, String stones)
{
int count = 0;
for(int i =0;i
class Solution {
public String defangIPaddr(String address) {
String ans=address.replace(".","[.]");
return ans;
}
}
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int ans=0;
for(int i=0;i
class Solution {
public int numJewelsInStones(String jewels, String stones) {
int c=0;
for(int j=0;j
class Solution {
public String defangIPaddr(String address){
return address.replace("." , "[.]");
}
}
class Solution {
public int finalValueAfterOperations(String[] operations) {
int n=operations.length;
int a=0;
//char[] arr=operations.tocharArray
for(int i=0;i
class HelloWorld {
public static void main(String[] args) {
for(int i=2;i
class HelloWorld {
public static void main(String[] args){
String []list = {"--X","X++","X++"};
int output = 0;
for(int i = 0;i
String ans="";
for(int i=0;i
Bro Java online complier lo user inputs thisukoni next leetcode lo cheppandi bro
class Solution {
public String defangIPaddr(String address) {
String result="";
for(int i=0;i
class Solution {
public String defangIPaddr(String address) {
address = address.replace(".","[.]");
return address;
}
}
Bro 😮🙏ne chaneel first time chusa No words ur teaching
I have dout Bro
I'm cmplt recently passed
Bcom computers with 0 skills
But i have boost confidence after watching ur videos
naku gud package vunha job ravli anta
Dsa with java chalu na bro or parrel ga inka em anaa nercunKnta best
Dsa with java vera language anta em suggest cesthavhu bro nuvu??
Plz reply
Big thanks for ur teaching...🙏
I will suggest you DSA with c++
Incase nuvu web dev or android dev side velali ankunte dsa with java cheyu bro along with development. Incase aiml or datascience side velthe dsa with python cheyu bro . All the best
@@engineeringanimuthyamthank youuuuuu Bro...❤
class HelloWorld {
public static void main(String[] args) {
String s= "aA";
String M="aAAbbb";
int ans= 0;
for(int i=0;i
1. class Solution {
public int finalValueAfterOperations(String[] operations) {
int X=0;
int temp=0;
for(int i=0;i
Bro Naku Java Konchem ae vacchu bro ee videos lo nerchukovacha
Yes bro absolutely
@@engineeringanimuthyam ok bro .Thanks❤❤
class HelloWorld {
public static void main(String[] args) {
String ans="";
String S="1.6.0.1";
for (int i=0;i
Hello, Bro One Suggestion From My Side.., Yemiti antey Every Problem ki Constraints Yeela Work Chestheya Chussi Cheppu Bro, Please Make a One Video on it, Basically.., Constraints Medha Algorithm Depend Ayyi Vuntadi kada Bro,,, Please make one Video On it Bro... This is My Request
thank you soo much bro
class Solution {
public int finalValueAfterOperations(String[] operations) {
int X=0;
for(int i=0;i