BookmarkSubscribeRSS Feed
jmhorstman
Obsidian | Level 7

Hi All,

 

Has anyone else out there been doing the Advent of Code this holiday season?  You get a fun little coding puzzle every day of the advent season (December 1 through 25).  They can be done using any programming tool or language, but naturally I'm doing them all in SAS. 

 

I'd love to compare solutions if anyone else is interested.  In several cases, I've come up with one proc-oriented solution and another data-step-only solution (frequently involving hash objects).  I've already learned a few new tricks.

 

Unfortunately, you won't find me on the leaderboard.  You get there by being one of the first few to submit a correct solution after each day's problem goes live at midnight (Eastern time).  If I'm up writing code after midnight, it's only because something has gone very, very wrong.  🙂

 

Josh Horstman

1 REPLY 1
Rick_SAS
SAS Super FREQ

Interesting. The Dec 6 problem asks for locations that are near any points in a given set. You can use the DISTANCE function in SAS/IML (which supports Manhatten distance) to solve the problem. A similar idea was discussed in this blog post about nearest neighbors.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 675 views
  • 2 likes
  • 2 in conversation