Red-Green-Code

Deliberate practice techniques for software developers

  • Home
  • About
  • Contact
  • Project 462
  • CP FAQ
  • Newsletter

Using Integers and Longs in Java

By Duncan Smith Leave a Comment Oct 7 0

Programming puzzles frequently involve manipulation of integers. And even problems that are mainly about string manipulation, character sets, or floating point arithmetic need integers for array indexes and counters. So it pays to know how to use them. In this article, I’m going to cover some of the quirks of integers and longs as implemented […]

Continue

Results Not Guaranteed

By Duncan Smith Leave a Comment Sep 30 0

In 2013, I took an experimental course on deliberate practice that Cal Newport and Scott Young were developing. In the email announcing the course, Cal warned: “If … you’re expecting guaranteed results, this pilot might not be a good fit.” It’s a standard marketing technique for products and services to promise guaranteed results. But that’s […]

Continue

Is There No Map?

By Duncan Smith Leave a Comment Sep 23 0

In Linchpin, Seth Godin has this to say about giving advice: Telling people leadership is important is one thing. Showing them step by step precisely how to be a leader is impossible. “Tell me what to do” is a nonsensical statement in this context. There is no map. No map to be a leader, no […]

Continue

What is competitive programming?

By Duncan Smith Leave a Comment Sep 16 0

What is competitive programming? Here are a few definitions. From Wikipedia: Competitive programming is a mind sport usually held over the Internet or a local network, involving participants trying to program according to provided specifications. … A programming competition generally involves the host presenting a set of logical or mathematical problems to the contestants … […]

Continue

Stack Overflow vs. Competitive Programming Questions

By Duncan Smith Leave a Comment Sep 9 1

I like to keep an eye on what people are saying about competitive programming, so I subscribe to a Google Alert for that phrase. Almost every day, I get a few results. While programmers are opinionated about a lot of things, this topic seems to bring out especially strong opinions. Here are some places where […]

Continue

Getting Started With UVa Online Judge: The 3n+1 Problem

By Duncan Smith Leave a Comment Sep 2 0

If you’re interested in competitive programming, or you just like solving programming puzzles, UVa Online Judge is not a bad place to start. During the many years that it has been active, people have written books, supporting web sites, and sample code to help programmers get more out of it. As my contribution to the […]

Continue

Solving UVa 978 With Unit Tests

By Duncan Smith Leave a Comment Aug 26 0

Last week, I wrote about how unit testing can improve your competitive programming practice. As promised, this week I’m going to go through an example of the unit testing process. For an example problem, I’ll be using UVa 978: Lemmings Battle! See above for a picture of a ferocious lemming. Problem Summary Lemmings Battle! is […]

Continue

Unit Testing Your Competitive Programming Solutions

By Duncan Smith Leave a Comment Aug 19 0

A couple of months ago, I wrote an article about a type of unit test called a learning test. The goal of learning tests is improving your understanding of how code works, rather than verifying functionality or influencing design, the traditional goals of unit testing. This week, I’m going to discuss those traditional goals of […]

Continue

UVa 11572: Unique Snowflakes

By Duncan Smith Leave a Comment Aug 12 2

UVa 11572 contains a story about a magic snowflake-capturing machine, but the underlying puzzle can be stated quite simply: Given a sequence of integers, find the length of the longest contiguous subsequence containing no repeated elements. The sequence given in the sample input is: 1, 2, 3, 2, 1 The subsequence 1, 2, 3, 2 […]

Continue

Summer Review

By Duncan Smith Leave a Comment Aug 5 2

It’s summertime here in the Pacific Northwest, and seven months into the first year of this blog. After thirty weekly posts, I thought it would be a good time to consider the themes that have come up so far this year. If you’re a new reader, I hope you’ll find this to be a useful […]

Continue
  • « Previous Page
  • 1
  • …
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • Next Page »

Getting Started

Are you new here? Check out my review posts for a tour of the archives:

  • 2023 in Review: 50 LeetCode Tips
  • 2022 in Review: Content Bots
  • 2021 in Review: Thoughts on Solving Programming Puzzles
  • Lessons from the 2020 LeetCode Monthly Challenges
  • 2019 in Review
  • Competitive Programming Frequently Asked Questions: 2018 In Review
  • What I Learned Working On Time Tortoise in 2017
  • 2016 in Review
  • 2015 in Review
  • 2015 Summer Review

Archives

Recent Posts

  • Do Coding Bots Mean the End of Coding Interviews? December 31, 2024
  • Another Project for 2024 May 8, 2024
  • Dynamic Programming Wrap-Up May 1, 2024
  • LeetCode 91: Decode Ways April 24, 2024
  • LeetCode 70: Climbing Stairs April 17, 2024
  • LeetCode 221: Maximal Square April 10, 2024
  • Using Dynamic Programming for Maximum Product Subarray April 3, 2024
  • LeetCode 62: Unique Paths March 27, 2024
  • LeetCode 416: Partition Equal Subset Sum March 20, 2024
  • LeetCode 1143: Longest Common Subsequence March 13, 2024
Red-Green-Code
  • Home
  • About
  • Contact
  • Project 462
  • CP FAQ
  • Newsletter
Copyright © 2025 Duncan Smith