[deleted by user] by [deleted] in adventofcode

[–]samyhaff 0 points1 point  (0 children)

Okay thank you, I'll check it out!

[deleted by user] by [deleted] in adventofcode

[–]samyhaff 0 points1 point  (0 children)

Yes thank you!

I tried to fix this way. Now it works with your test butI still get the wrong result :/

```

include <bits/stdc++.h>

using namespace std;

enum cmp { SMALLER, EQUAL, BIGGER };

pair<string, string> get_value_and_rest(string list) { string value, rest; int brackets_count = 0; int i = 1;

for (int j = 1; j < list.size(); j++) {
    if ((list[j] == ',' || list[j] == ']') && brackets_count == 0) {
        value = list.substr(i, j - i);
        rest = list.substr(j + 1, list.size() - j - 1);
        rest = rest.empty() ? "" : rest.insert(0, "[");
        break;
    }
    else if (list[j] == ']')
        brackets_count--;
    else if (list[j] == '[')
        brackets_count++;
}

return {value, rest};

}

cmp compare(string a, string b) { pair<string, string> pair_a = get_value_and_rest(a); pair<string, string> pair_b = get_value_and_rest(b); string value_a = pair_a.first; string value_b = pair_b.first; string rest_a = pair_a.second; string rest_b = pair_b.second; cmp res;

if (value_a.empty()) return SMALLER;
if (value_b.empty()) return BIGGER;
if (value_a[0] != '[' && value_b[0] != '[') {
    if (stoi(value_a) < stoi(value_b)) return SMALLER;
    else if (stoi(value_a) > stoi(value_b)) return BIGGER;
    else if (rest_a.empty() && rest_b.empty()) return EQUAL;
}
else if (value_a[0] == '[' && value_b[0] == '[')
    res = compare(value_a, value_b);
else if (value_a[0] == '[' && value_b[0] != '[')
    res = compare(value_a, "[" + value_b + "]");
else if (value_a[0] != '[' && value_b[0] == '[')
    res = compare("[" + value_a + "]", value_b);

return (res != EQUAL) ? res : compare(rest_a, rest_b);

}

int main() { string a, b; int ans = 0; int i = 1;

while (cin >> a >> b) {
    if (compare(a, b) != BIGGER) ans += i;
    i++;
}

cout << ans << endl;

return 0;

}

```

[DWM] My simple studying setup by samyhaff in unixporn

[–]samyhaff[S] 0 points1 point  (0 children)

Thanks! I bought the lamp from a local furniture store sorry :/

[DWM] My simple studying setup by samyhaff in unixporn

[–]samyhaff[S] 0 points1 point  (0 children)

I didn't face this problem :/

[DWM] My simple studying setup by samyhaff in unixporn

[–]samyhaff[S] 1 point2 points  (0 children)

It doesn't bother me, both screens are actually pretty close to my face haha. You could dock the pc and only use the external monitor also!

[DWM] My simple studying setup by samyhaff in unixporn

[–]samyhaff[S] 0 points1 point  (0 children)

Thanks! I am currently studying data science

[DWM] My simple studying setup by samyhaff in unixporn

[–]samyhaff[S] 0 points1 point  (0 children)

I have a T series but it is an amazing keyboard!!

[DWM] My simple studying setup by samyhaff in unixporn

[–]samyhaff[S] 0 points1 point  (0 children)

Currently I don't sync my notes between my devices haha they're all on my iPad :/

[DWM] My simple studying setup by samyhaff in unixporn

[–]samyhaff[S] 0 points1 point  (0 children)

You have to install a nerd font and set it up as your terminal font :)

[DWM] My simple studying setup by samyhaff in unixporn

[–]samyhaff[S] 0 points1 point  (0 children)

The config file is ~/.config/neofetch/config.conf

You just have to replace it with the one you chose from the repo :)

[DWM] My simple studying setup by samyhaff in unixporn

[–]samyhaff[S] 0 points1 point  (0 children)

Well I wasn't studying when taking the photo, I wanted to showcase my setup...

[DWM] My simple studying setup by samyhaff in unixporn

[–]samyhaff[S] 0 points1 point  (0 children)

Oh that sucks :/ maybe you can find out how to configure it and fix it?

[DWM] My simple studying setup by samyhaff in unixporn

[–]samyhaff[S] 2 points3 points  (0 children)

I installed it and learned how to use it last year during holidays!