A large language model fine-tuned for coding tasks.
So I had to put it to the test against ChatGPT!
Here are my findings [THREAD]:
✍️ Before we start:
- This is by no means a conclusive/thorough study. This was done for fun testing different LeetCode coding questions (you can try on your own to practice!) just to see how they would do.
- I’ll be using ChatGPT with GPT-3.5 and Code Llama Instruct - 34B through Perplexity.
- Most of the time Perplexity was printing the code with no indentations, I added the indentations manually.
- They might do okay if you ask them a second time or express the question differently. However, I just wanted to test them in a single prompt with no variations.
QUESTION 1
“Use Python. You are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the end of the merged string.
“Use Python. Given a string s, reverse only all the vowels in the string and return it.
The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in both lower and upper cases, more than once.
Example 1:
Input: s = "hello"
Output: "holle"
🟢 ChatGPT: +1
🔵 Code Llama: 0
QUESTION 3
“Use Python. Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.
Note that you must do this in-place without making a copy of the array.
Example 1:
Input: nums = [0,1,0,3,12]
Output: [1,3,12,0,0]”
🟢 ChatGPT: +1
🔵 Code Llama: 0
QUESTION 4
“Use Python. You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots.
Given an integer array flowerbed containing 0's and 1's, where 0 means empty and 1 means not empty, and an integer n, return true if n new flowers can be planted in the flowerbed without violating the no-adjacent-flowers rule and false otherwise.
Example 1:
Input: flowerbed = [1,0,0,0,1], n = 1
Output: true
Example 2:
Input: flowerbed = [1,0,0,0,1], n = 2
Output: false”
🟢 ChatGPT: +1
🔵 Code Llama: +1
QUESTION 5
“Use Python. Given an input string s, reverse the order of the words.
A word is defined as a sequence of non-space characters. The words in s will be separated by at least one space.
Return a string of the words in reverse order concatenated by a single space.
Note that s may contain leading or trailing spaces or multiple spaces between two words. The returned string should only have a single space separating the words. Do not include any extra spaces.
Example 1:
Input: s = "the sky is blue"
Output: "blue is sky the"”
🟢 ChatGPT: +1
🔵 Code Llama: +1
QUESTION 6
“Use Python. Given a string s and an integer k, return the maximum number of vowel letters in any substring of s with length k.
Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.
Example 1:
Input: s = "leetcode", k = 3
Output: 2
Explanation: "lee", "eet" and "ode" contain 2 vowels.”
🟢 ChatGPT: +1
🔵 Code Llama: +1
QUESTION 7
“Use Python. You are given a string s, which contains stars *.
In one operation, you can:
Choose a star in s.
Remove the closest non-star character to its left, as well as remove the star itself.
Return the string after all stars have been removed.
Example 1:
Input: s = "leet**cod*e"
Output: "lecoe"”
🟢 ChatGPT: +1
🔵 Code Llama: 0
QUESTION 8
“Use Python. Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature. If there is no future day for which this is possible, keep answer[i] == 0 instead.
• OpenAI GPT 4.5
• Claude 3.7 Sonnet
• Alibaba Wan 2.1 AI video
• Grok 3 & Perplexity Voice
• Google Gemini Code Assist
• Amazon AI assistant Alexa+
• ElevenLabs Speech-to-Text
• Hume AI new LLM built for TTS
Here’s everything you need to know:
1. OpenAI has launched GPT-4.5, its largest AI model yet.
It focuses on unsupervised learning, improving intuition and reducing hallucinations.
Early testers say interactions feel more natural. Currently available to Pro users.
After a couple of hours and +1000 lines of code generated, I have now a fully functional 2D vertical jumping game.
With different heroes, monsters, platforms, difficulties, and lives.
Here are the prompts and process I followed:
🧑💻CODING PART
I will provide the prompt below, let me give you a few tips:
- Don’t try to ask for every single detail and feature. Try to first ask for a very simple game.
- For complex tasks, use the Grok Think button, it’s quite good.
- Ask for shapes as your characters, platforms, etc. Do not worry about the assets at first.
- You will probably get some errors. Just ask @Grok to solve them for you if you don’t know.
Once you have a first version working, you can start adding the images and other features.
In my case, I added the settings, lives, score, animations, different platforms, main menu and enemies later.
Prompt I used to get the first version of the code:
“Create a basic 2D vertical jump game using HTML/CSS. The characters and platforms should be just shapes (will add assets later). Code everything in one file.”
OpenAI has released a new prompting guide for their reasoning models.
It emphasizes simplicity, avoiding chain-of-thought prompts, the use of delimiters, and when to use them.
Here’s a breakdown and an optimized prompt to have it write like you:
ChatGPT models excel in different ways:
🔹 o-series (“the planners”)
• Think deeply for complex tasks
• Great at strategy, planning & decision-making
• Ideal for expert-level fields: math, science, finance, law
🔹 GPT (“the workhorses”)
• Optimized for speed & efficiency
• Excels at straightforward execution • Best when cost & speed outweigh perfect accuracy
You should use the o-series when:
1. Navigating ambiguous tasks 2. Passing large amounts of unstructured information 3. Multi-step agentic planning 4. Visual reasoning 5. Reviewing, debugging, and improving code 6. Finding relationships and nuance across a large dataset