383
you are viewing a single comment's thread
view the rest of the comments
[-] TheLazyNerd@europe.pub 1 points 8 hours ago* (last edited 8 hours ago)

I'm not too good with java, but it should be something like this:

public static int convertRomanNumeral(string n){Map.of("M","DD","CD","CCCC","D","CCCCC","C","LL","XL","XXXX","L","XXXXX","X","VV","IV","IIII","V","IIIII");.forEach((k,v)->{n=n.replace(k,v);});return n.length();}

this post was submitted on 11 Oct 2025
383 points (100.0% liked)

Programmer Humor

26827 readers
1889 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS