Shortest Hexadecimal Color Shorthand

Given a valid 7-character hexadecimal RGB color color in the format #RRGGBB, return the full 7-character representation of the shorthand color #RGB that has minimum squared RGB distance from `co...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: