def change(s): d = {} newString="" for i in s: if i not in d: d[i] = 1 else: d[i]+=1 for key, val in d.items(): newString = newString + str(val) + key return newString print(change("AAABBC")) Time complexity = O(n) Space complexity = O(n)
ഇങ്ങനെ പോയാമതി മാറ്റം വരുത്തണ്ട നിങ്ങൾ real ക്ലാസ് എടുക്കുന്ന പോലെ ആണ് നിങ്ങൾ ക്ലാസ് എടുക്കുന്നത് നിങ്ങളുടെ ചളികളും ഞങ്ങൾ ആസ്വദിച്ചിട്ടാണ് ക്ലാസ് കേൾക്കുന്നത് , തമഷകല് ഇല്ലാതെ ക്ലാസ് എടുത്താൽ കുറച്ചു kazinjal മടുപ്പ് തോന്നും
in Java Script o(n)st function shafin(str) { let count = 1; let result = ''; for (let i = 0; i < str.length; i++) { if (str.charAt(i) === str.charAt(i + 1)) { count++; } else { result += count + str.charAt(i)+' '; count = 1; } } console.log(result); } shafin('aaabbc')
public class Main12 { public static void equator(String str) { int count=1; StringBuilder st2 =new StringBuilder(); int i=0; char[] charArray=str.toCharArray(); while(i
Stack quee linked list, double linked ithokke c yil ulla data structures name alle, java, python, c# avideyum e same name thanne aano indakuka, atho oro language inum avrdutheya data structures indo. Onn elupathil xplain cheyyamo
ellarum ethentha evide comment cheythu natikune. *CROSSROADS* challi store alla pakka content center for mallus anu. pinney challi oru bonus ayi tharunu ene ullu challi kanan mathram varanda (challiyadi is not and high income skill Lol) so skills set chey kude challiyadi kelk
input: AAABBCDD output : 3A2B1C2D public class CountCharacter { public void countChar(String text){ int i = 0; String s = ""; while(i < text.length()){ int k = 1; while(i + k < text.length() && text.charAt(i) == text.charAt(i+k)){ k++; } s = s + k + ""; s = s + text.charAt(i); i = i + k; } System.out.println(s); } public static void main(String[] args) { CountCharacter inString = new CountCharacter(); inString.countChar("AAABBCDD"); } }
Hey ,can anyone please tell me if this code is good or not. I am getting the desired output .But ,I don't feel like the code is good. Hope to get a reply. public class sample {
time Complexity=O(n); space Complexity=O(n); public class SameString { public static String newString(String str){ int letterCount=1; char letterString; char[] charArray=new char[str.length()]; for(int i=0;i
class NoOfOccurenceOfCharacters { static final int MAX_CHAR = 256; static void getOccuringChar(String str) { int count[] = new int[MAX_CHAR]; int len = str.length(); for (int i = 0; i < len; i++) count[str.charAt(i)]++; // Create an array of given String size char ch[] = new char[str.length()]; for (int i = 0; i < len; i++) { ch[i] = str.charAt(i); int find = 0; for (int j = 0; j
ആദ്യമായിട്ട് ഞാൻ ഉറക്കം വരാതെ full video interestൽ കണ്ടു..
public class Main
{
public static String change(String str) {
int count = 1;
String newString = "";
for(int i=1;i
def change(s):
d = {}
newString=""
for i in s:
if i not in d:
d[i] = 1
else:
d[i]+=1
for key, val in d.items():
newString = newString + str(val) + key
return newString
print(change("AAABBC"))
Time complexity = O(n)
Space complexity = O(n)
congrats 🥳
you’re the winner 👏🏼
please send your photo and account details to 7034395811
I like chaii more than content
Ethupolathe valuable aayittulla challenges pratheekshikkunnu
sure 💪🏼
check out our plans for 2021
th-cam.com/video/BRWBvQxklDU/w-d-xo.html
Nikhil Bro and team 🥳🥳🥳🥳
ഇങ്ങനെ പോയാമതി മാറ്റം വരുത്തണ്ട നിങ്ങൾ real ക്ലാസ് എടുക്കുന്ന പോലെ ആണ് നിങ്ങൾ ക്ലാസ് എടുക്കുന്നത് നിങ്ങളുടെ ചളികളും ഞങ്ങൾ ആസ്വദിച്ചിട്ടാണ് ക്ലാസ് കേൾക്കുന്നത് , തമഷകല് ഇല്ലാതെ ക്ലാസ് എടുത്താൽ കുറച്ചു kazinjal മടുപ്പ് തോന്നും
in Java Script o(n)st
function shafin(str) {
let count = 1;
let result = '';
for (let i = 0; i < str.length; i++) {
if (str.charAt(i) === str.charAt(i + 1)) {
count++;
} else {
result += count + str.charAt(i)+'
';
count = 1;
}
}
console.log(result);
}
shafin('aaabbc')
A mutable object can be changed after it's created, and an immutable object can't.
public class Main12 {
public static void equator(String str) {
int count=1;
StringBuilder st2 =new StringBuilder();
int i=0;
char[] charArray=str.toCharArray();
while(i
😃
Stack quee linked list, double linked ithokke c yil ulla data structures name alle, java, python, c# avideyum e same name thanne aano indakuka, atho oro language inum avrdutheya data structures indo. Onn elupathil xplain cheyyamo
Ithonnum language specific alla. Ella language ilun cheyyan pattum
Chali uyir😎
😂😂😂
ellarum ethentha evide comment cheythu natikune. *CROSSROADS* challi store alla pakka content center for mallus anu. pinney challi oru bonus ayi tharunu ene ullu challi kanan mathram varanda (challiyadi is not and high income skill Lol) so skills set chey kude challiyadi kelk
String arrayude value aayittu str. Length() assign cheyyumbol error varunnu. Anyone can help me...?
❤️❤️❤️❤️
Chaliyadi illand sugamillaannu
Class maathram aayal bore aayirikkum...
Fun koodi venam
ഓക്കേ ഓക്കേ 👍🏼
C++11 there is a type for string as in the case of Java.
yeah 👍🏼
input: AAABBCDD
output : 3A2B1C2D
public class CountCharacter {
public void countChar(String text){
int i = 0;
String s = "";
while(i < text.length()){
int k = 1;
while(i + k < text.length() && text.charAt(i) == text.charAt(i+k)){
k++;
}
s = s + k + "";
s = s + text.charAt(i);
i = i + k;
}
System.out.println(s);
}
public static void main(String[] args) {
CountCharacter inString = new CountCharacter();
inString.countChar("AAABBCDD");
}
}
Part 8 nte cash award enthaayi🤔
Hey ,can anyone please tell me if this code is good or not.
I am getting the desired output .But ,I don't feel like the code is good.
Hope to get a reply.
public class sample {
public static String encode(String str) {
char[] charArray = str.toCharArray();
String newString ="";
int count = 0;
char tempChar = charArray[0];
for(char val : charArray) {
if(tempChar == val) {
count++;
}
else {
newString += String.valueOf((char)(count+'0'));
newString += String.valueOf(tempChar);
tempChar = val;
count = 1;
}
}
newString += String.valueOf((char)(count+'0'));
newString += String.valueOf(tempChar);
return newString;
}
public static void main(String ar[]) {
System.out.println(encode("abbbbbccccddd"));
}
}
const setChali = true
Chali venam
Chali Chali alallo?
Avan vannu
Ayyo chali veenam tto illenkil oru sukam poora just like only studying no entertainment
conversation must Bigile. ellenki verum sada tutorial avoole
chali venda enno 😭 this is cheating cinema style cheating 😥
occurence of alphabets numbered
public class ChangeToNumbersOccuingAlphabet {
public static String numberOfAlphabets(String str) {
int count=1;
String numberString="";
for(int i=0;i
First
Ithu matthi serious aayal bore aayirikum.
time Complexity=O(n);
space Complexity=O(n);
public class SameString {
public static String newString(String str){
int letterCount=1;
char letterString;
char[] charArray=new char[str.length()];
for(int i=0;i
class NoOfOccurenceOfCharacters {
static final int MAX_CHAR = 256;
static void getOccuringChar(String str)
{
int count[] = new int[MAX_CHAR];
int len = str.length();
for (int i = 0; i < len; i++)
count[str.charAt(i)]++;
// Create an array of given String size
char ch[] = new char[str.length()];
for (int i = 0; i < len; i++) {
ch[i] = str.charAt(i);
int find = 0;
for (int j = 0; j
O(n)TS
public static string DuplicateCharCounter( string str){
int count = 1;
StringBuilder st = new StringBuilder();
for(int i = 1;i
Njan ith cheythu nokki appo str[i]nte aa bhaagathu error und
Ath string aan .Njan cheythath arrayude operation aanenn vayichappo mansilayi
ആ ചിരി ഒന്ന് കുറക്കോ @nikhil sir
അത് മാത്രം പറയരുത് 😫
public class CountAndDisplayCharacters {
public static void main(String[] args) {
String input = "AABBBCCCCDEEEAA";
countAndPrintCharacters(input);
}
private static void countAndPrintCharacters(String input) {
char prev = 0;
int count = 1;
String pattern = "";
for (int i = 0; i < input.length(); i++) {
if (i == 0) {
prev = input.charAt(i);
} else {
if (input.charAt(i) == prev) {
count++;
} else {
pattern = pattern+prev+count;
prev = input.charAt(i);
count = 1;
}
}
}
pattern = pattern+prev+count;
System.out.println(pattern);
}
}
O(n)ST
Challi onnum Venda. Padippicha mathi