Skip to content

Commit 9f28dff

Browse files
authored
Merge pull request #352 from sir-gon/develop
[REFACTOR] Sonarcloud: Rename this local variable to match the regula…
2 parents 8a949db + a2f793e commit 9f28dff

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

exercises/hackerrank/interview_preparation_kit/dictionaries_and_hashmaps/frequency_queries.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ const __NOT_FOUND__ = 0
1414
const __FOUND__ = 1
1515

1616
func freqQuery(queries [][]int32) []int32 {
17-
data_map := make(map[int32]int32)
17+
dataMap := make(map[int32]int32)
1818
freq := make(map[int32]int32)
1919
var result []int32
2020

2121
for _, query := range queries {
2222
switch query[0] {
2323
case __INSERT__:
24-
if data_map[query[1]] == __INITIAL__ {
25-
data_map[query[1]] = 1
24+
if dataMap[query[1]] == __INITIAL__ {
25+
dataMap[query[1]] = 1
2626
} else {
27-
freq[data_map[query[1]]]--
28-
data_map[query[1]]++
27+
freq[dataMap[query[1]]]--
28+
dataMap[query[1]]++
2929
}
30-
freq[data_map[query[1]]]++
30+
freq[dataMap[query[1]]]++
3131
case __DELETE__:
32-
if data_map[query[1]] > __INITIAL__ {
33-
freq[data_map[query[1]]]--
34-
data_map[query[1]]--
35-
freq[data_map[query[1]]]++
32+
if dataMap[query[1]] > __INITIAL__ {
33+
freq[dataMap[query[1]]]--
34+
dataMap[query[1]]--
35+
freq[dataMap[query[1]]]++
3636
}
3737
case __SELECT__:
3838
if freq[query[1]] > 0 {

exercises/hackerrank/interview_preparation_kit/greedy_algorithms/greedy_florist.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ func getMinimumCost(k int32, c []int32) int32 {
1717
slices.Reverse(flowers)
1818

1919
total := int32(0)
20-
k_customers := int(k)
20+
kCustomers := int(k)
2121

2222
for i, flower_cost := range flowers {
23-
var position = int32(i / k_customers)
23+
var position = int32(i / kCustomers)
2424
total += int32(position+1) * int32(flower_cost)
2525
}
2626

0 commit comments

Comments
 (0)