The Challenge Your task is to input a string, and output the number of spaces in the string. This is Code Golf, so least number of bytes win. Test Cases "test" => 0 "Hello, World!" => 1 "C O D E G O L F" => 7 " " => 6
brainteaser


March 4, 2021This brainteaser looks so simple, but it’s not! There are 50 bikes with a tank that has the capacity to go 100 km. Using these 50 bikes, what is the maximum distance that you can go?

January 22, 2021This week, I’m going back to the good ole engineering brainteaser. This one is for all you who have to fight to find a parking spot at work! The probability of finding the parking slot occupied is 1/3. You find it empty for 9 consecutive days. Find the probability that it will be empty on the 10th day. You can find this brainteaser and many others at GineersNow.com: Can You Answer These Brain Teasers Like a Silicon Valley Engineer?

February 29, 2020In honor of NFL Super Bowl LIV this past Sunday, here’s a football physics question to tease your brain! In U.S. football, after a touchdown the team has the opportunity to earn one more point by kicking the ball over the bar between the goal posts. The bar is 3.048 meters above the ground, and the ball is kicked from ground level, 10.9728 meters horizontally from the bar. If the ball is kicked at 37 degrees above the horizontal, what must its initial speed be if it is to just clear the bar? Express your answer in meters per second (m/s). The answer can be found here!

February 17, 2020[From the website of Dr. Donald Simanek—see further down.] Browsing Martin Gardner’s books I stumbled on this diabolical puzzle. Gardner calls it “an incredible problem”. He traces it back too Samuel I. Jones’ Mathematical Nuts, 1932, p. 86. It is seen on the web in various forms, often ambiguous in wording, along with endless discussions often leading nowhere. I have tried to restate it to remove ambiguity (which isn’t easy). A hole is drilled completely through a sphere, directly through, and centered on, the sphere’s center. The hole in the sphere is a cylinder of length 6 inches. What is the volume of the remainder of the sphere (not including the material drilled out). You’d think there’s not enough information given. But there is. The solution does not require calculus. Gardner gives an insightful solution that requires only two sentences, including just one equation. Visit From mathworld.wolfram.com for more info. The answer is provided by Doctor Donald Simanek, Professor of Physics Emeritus at Lockhaven University. Visit Donald Simanek’s page at Lockhaven.edu for more brainbending physics puzzles! Now that’s an interesting answer! Keep scrolling down… Wanna see a video answer to the brainteaser? This video was created by Tom McNaney Jr., Generalist Applications Engineer, Fellow at PTC (the company that I currently work for). Here is his detailed approach to the brainteaser using PTC’s flagship CAD program Creo Parametric! For the Holey Sphere challenge, Creo Parametric says the volume is 113.097 in^3. Interestingly, the volume remains constant regardless of the sphere Radius. Cool. I have no idea what the mathematical formula is, but probably 4/3*Pi*(something)^3. Who needs advanced math when they have Creo or Mathcad?

January 27, 2020Here’s a quick little brainteaser for young and old alike! Slice the square into 4 identical sections, so that in each section there is 1 caterpillar with its leaf. One caterpillar will not have a leaf, she is taking a diet. This and many other great geometry puzzles can be found on BrainDen.com!

January 20, 2020When writing fun stuff for my company’s global communications site, sometimes I like to throw in a brainteaser every now and again—especially given that a lot of PTC’s employees and customers are engineers. So here are two geometry puzzles to get those old mental juices flowing! 64 = 65 Geometry Paradox Where does the hole in second triangle come from (the partitions are the same)? Write Numbers Write the numbers from 1 to 8 into the squares, so that the squares with consecutive numbers do not touch (neither edges nor corners). These and other amazing geometry puzzles can be found here on BrianDen.com.

October 14, 2019How many squares are in this image? But here’s the twist: you have to present your logic behind the answer.