Skip to content

Commit 4ecee18

Browse files
committed
Updated variable/type names to better reflect their purpose/function
1 parent 8c1ad0b commit 4ecee18

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: CodeWars/src/UpsideDownNumbers/Solution1.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <stack>
22
#include <unordered_map>
33
#include <queue>
4-
struct CustomMap
4+
struct RotationMap
55
{
66
std::unordered_map<int, int> hashMap
77
{
@@ -35,7 +35,7 @@ void storeDigits(int x, std::queue<int>& queue, std::stack<int>& stack)
3535
int solve(int x, int y)
3636
{
3737
auto result{ 0 };
38-
CustomMap customMap;
38+
RotationMap vRotationMap;
3939
while (x < y)
4040
{
4141
if (x / 10 == 0)
@@ -46,17 +46,17 @@ int solve(int x, int y)
4646
continue;
4747
}
4848
std::queue<int> origDigitStore;
49-
std::stack<int> rotatedDigitStore;
50-
storeDigits(x, origDigitStore, rotatedDigitStore);
49+
std::stack<int> reverseDigitStore;
50+
storeDigits(x, origDigitStore, reverseDigitStore);
5151
auto count{ 0 };
5252
while (true)
5353
{
54-
if (origDigitStore.front() != customMap[rotatedDigitStore.top()])
54+
if (origDigitStore.front() != vRotationMap[reverseDigitStore.top()])
5555
break;
5656

5757
++count;
5858
origDigitStore.pop();
59-
rotatedDigitStore.pop();
59+
reverseDigitStore.pop();
6060
if (!std::size(origDigitStore))
6161
{
6262
++result;

0 commit comments

Comments
 (0)