DCP-329: String Frequency Query Back to All Problems

Easy Beginners Problems > Ad-hoc


You are given a string **S**, consisting of lowercase English alphabets, you have to perform following operations on it: 1 X Y : Change the character at index X to character Y 2 Y : Print the total number of occurrences of character Y in the string Input: ------ There will be only one input, which begins with string **S**. <br> Then there will be integer **Q** on the next line. <br> Then, following **Q** lines will contain query of either type 1 or type 2, begins with an integer denoting type of query.<br> if query is of type 1 followed by **space separated integer and character** , otherwise there will be **a single character**, as shown in above format.<br> See the sample Input/Output section for more details. Output: ------- For every query of ***type 2***, print an integer in a line denoting the **total number of character Y that occurs in current string.** Constraints: ------- **1<=|S|<=10^5,** |S| denotes length of string S. **1<=Q<=10^5** **0<=X<=( |S|-1 )**, indexing are 0-based. **'a'<=Y<='z'** Sample Input ------------ devskill 5 2 l 2 d 1 0 l 2 l 2 d Sample Output ------------- 2 1 3 0


Problem Setter:

Bishal Gautam

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 0.50
C++ 0.50
C++14 0.50
C# 1.00
Go 1.00
Java 1.00
JavaScript 1.00
Objective-C 1.00
Perl 1.00
PHP 1.00
Python 1.00
Python3 1.00
Ruby 1.00
VB.Net 1.00

Problem Stats

180/572

Solve/Submission

Ranking

# User Language Timing
01 Morass Cpp14 0.01s
02 monir769 C 0.02s
03 prateepm Cpp14 0.02s
04 souravahmed C 0.02s
05 afzalul C 0.02s
06 Mahbub_Rahman Cpp 0.02s
07 Optimus_primeV2 Cpp14 0.02s
08 fsshakkhor Cpp14 0.02s
09 I_See_You Cpp14 0.02s
10 seyedssz Cpp14 0.02s
11 kitorp Cpp14 0.02s
12 dipta007 Cpp14 0.02s
13 kissu_pari_na Cpp14 0.02s
14 ssavi Cpp14 0.02s
15 ovis96 Cpp14 0.02s
16 skmonir Cpp14 0.02s
17 kazinayeem Cpp 0.02s
18 prodipdatta7 Cpp14 0.02s
19 MRITuhin Cpp14 0.02s
20 rajdipsaha Cpp 0.02s
21 emrul Cpp14 0.02s
22 pulak_ict_mbstu Cpp 0.02s
23 Ishraq_Nibir C 0.03s
24 feodorv C 0.03s
25 jayed_al_hasan Cpp14 0.03s
26 Fahim_Ahmed Cpp 0.03s
27 adamantium Cpp 0.03s
28 nasif2587 Cpp14 0.03s
29 anik_JU Cpp14 0.03s
30 Bruteforceman Cpp14 0.03s
31 Koushik_12 Cpp 0.03s
32 moshiur_cse15 Cpp14 0.03s
33 nuhu_iu Cpp 0.03s
34 Reayz Cpp 0.03s
35 Rajib_119 Cpp 0.03s
36 Nirjhor Cpp14 0.03s
37 nazmul_bzs Cpp14 0.03s
38 Nazmul_WUB Cpp 0.03s
39 daihan_mbstu Cpp14 0.03s
40 tariqiitju Cpp 0.03s
41 FariD Cpp14 0.04s
42 Zeronfinity Cpp14 0.05s
43 sakib_ruet_13 Cpp 0.05s
44 Jakir_Hossain_Sust Cpp14 0.06s
45 indroneel Cpp14 0.06s
46 _dipu Cpp14 0.06s
47 Anonta Cpp14 0.06s
48 ksohan Cpp 0.06s
49 Fahim_ju Cpp 0.06s
50 Digonta Cpp14 0.07s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support