Using the stdout to debug print the solution in the leetcode con

  • 时间:2020-09-07 12:03:44
  • 分类:网络文摘
  • 阅读:179 次

The leetcode web coding IDE has a premium debugger feature – however this is not enabled during the contest. Recently I found out that you can actually print to STDOUT and then when you run your solution – you will see the output – this is an easy yet powerful method to debug when you don’t have other better solutions.

leetcode-stdout-debugging-trick Using the stdout to debug print the solution in the leetcode contest leetcode online judge

leetcode-stdout-debugging-trick

This is a great way to debug your code when you don’t have a IDE at hand – sometimes I participated the weekly contests on iPad where I don’t have IDE and I don’t have access to the inbuilt leetcode debugger as well – in this case, the printing to stdout is the only practical way of debugging printing the variables. Prior to this, I can only change the code and return the variable as a debugging technique – which is very inefficient.

leetcode Using the stdout to debug print the solution in the leetcode contest leetcode online judge

leetcode

–EOF (The Ultimate Computing & Technology Blog) —

推荐阅读:
求这五个整数的平均数  求AB两地距离及原计划行驶时间  运输队要运2000件玻璃器皿  5厘米宽的纸6等分  据称是难倒数学教授的小学奥数题  3个动物进行200米的赛跑  8个谜语全猜对的有多少人  小学数学知识问答  在长方形ABCD里做一个如上图的半圆和扇形  学校买矿泉水24元一箱 
评论列表
添加评论