How ChatGPT helps to solve coding challenges
December 5, 2022
ChatGPT is a programming language that can write text that sounds like it was written by a person. I thought it might be interesting to try it out and see if it could help me solve some coding problems. In this article, I'll talk about how I've used ChatGPT and what I've learned from it.
Hey there! I don’t know about you, but I’m always looking for new tools and techniques to make my coding life more manageable. Recently, I’ve been curious about using ChatGPT to solve code challenges, so I tried it with the Advent of Code 2022.
For those unfamiliar, ChatGPT is a state-of-the-art language model developed by OpenAI that can generate human-like text. I thought it might be interesting to see if it could help me tackle some coding problems, so I decided to try it. In this article, I’ll share my experiences using ChatGPT and what I learned along the way.
Advent of Code is a yearly coding challenge event that begins on December 1st and runs through the end of the month.
Participants are given a series of challenges to solve using their coding skills, and the goal is to complete as many challenges as possible.
This year, I decided to try something different: I used a chatbot to help me solve the first challenge of Advent of Code 2022.
The first challenge was written in natural language and required me to write a program that could solve it.
I used NodeJS to build my solution and turned to a chatbot for help.
To my surprise, the chatbot understood the challenge and provided me with a working solution in just one attempt.
It was able to understand the challenge’s requirements and create a program to solve it.
This is the second part of the challenge, which was flawlessly solved by the chatbot using the context of the chat:
I was amazed by the chatbot’s ability to understand natural language and create runnable code.
It could read the challenge and understand what was required to solve it.
This saved me a lot of time and effort and allowed me to focus on other aspects of the challenge.
Overall, I was very impressed with the chatbot’s ability to help me solve the first challenge of Advent of Code 2022. It understood the challenge and provided me with a working solution in just one attempt, which saved me a lot of time and effort!
I would use a chatbot like this again in the future to help me solve similar coding challenges.
I’m sorry I wasn’t candid with you; from now on, I will try to be.
This whole article (or at least the part between horizontal lines) was indeed written by the same OpenAI chat I used to generate all the code for the first challenge of the Advent of Code 2022 !🤯.
I just wrote this prompt and let the chat do the rest:
Write a blog post about how I used this chat to solve the first challenge of the Advent of Code 2022.
The reason was to try to find if it could solve challenges written in natural language and building code to solve it (NodeJS in my case).
In conclusion, ChatGPT successfully generated a complete article using a simple prompt. The resulting article could accurately capture the prompt’s main points and expand upon them coherently and logically. This demonstrates the potential of large language models like ChatGPT to assist with various writing and coding tasks.
Acknowledgments
This post, originally on https://www.howdy.com/how-chatgpt-helps-to-solve-coding-challenges, was written for Howdy™, so I want to thank them for letting me share it with you on my website.
Significant Revisions
Dec 05, 2020: Original publication on howdy.com